Skip to content

Instantly share code, notes, and snippets.

@Gr8Gatsby
Last active February 7, 2018 20:08
Show Gist options
  • Save Gr8Gatsby/deabbaaa40303162d9eb to your computer and use it in GitHub Desktop.
Save Gr8Gatsby/deabbaaa40303162d9eb to your computer and use it in GitHub Desktop.
if(typeof Windows != 'undefined') {
// Create the picker
var picker = new Windows.ApplicationModel.Contacts.ContactPicker();
picker.desiredFieldsWithContactFieldType.append(Windows.ApplicationModel.Contacts.ContactFieldType.email);
// Open the picker for the user to select a contact
picker.pickContactAsync().done(function (contact) {
if (contact !== null) {
var output = "Selected contact:\n" + contact.displayName;
console.log(output);
} else {
// The picker was dismissed without selecting a contact
console.log("No contact was selected");
}
});
}
@UziTech
Copy link

UziTech commented Dec 1, 2015

Line 12 is missing .log after console

console.log("No contact was selected");

@Gr8Gatsby
Copy link
Author

@UziTech, thank you, finally fixed it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment