Skip to content

Instantly share code, notes, and snippets.

@kimat
Created November 14, 2014 17:06
Show Gist options
  • Save kimat/34f727b674080967bfc5 to your computer and use it in GitHub Desktop.
Save kimat/34f727b674080967bfc5 to your computer and use it in GitHub Desktop.
function onSuccess(contacts) {
alert('Found ' + navigator.contacts.length + ' navigator.contacts.');
};
function onError(contactError) {
alert('onError!');
};
// find all contacts with 'Bob' in any name field
var options = new ContactFindOptions();
options.filter = "Bob";
options.multiple = true;
var fields = ["displayName", "name"];
navigator.contacts.find(fields, onSuccess, onError, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment