Launches the Contact Picker for selecting a single contact.
Syntax
contactPicker.pickSingleContactAsync().done( /* Your success and error handlers */ );
Parameters
This method has no parameters.
Return value
Type: IAsyncOperation<ContactInformation>
The operation that launches the Contact Picker.
Remarks
To pick multiple contacts at once, use PickMultipleContactsAsync.
Use the SelectionMode property to control whether your app receives all of a contact's information, or just specific fields.
Examples
This example demonstrates how to use the PickSingleContactAsync method.
function selectContact() { var picker = Windows.ApplicationModel.Contacts.ContactPicker(); picker.commitButtonText = "Select"; picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields; picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.email); picker.pickSingleContactAsync().then(function (contact) { var contactElement = document.createElement("div"); contactElement.innerText = contact.name + " " + contact.emails[0].value; document.body.appendChild(contactElement); }); }
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012