Reputation: 621
I'm using Contact plugin in phonegap by following code
var options = new ContactFindOptions();
var options = {
multiple:true
}
options.multiple = true;
var fields = ["displayName","phoneNumbers"];
navigator.contacts.find(fields, onSuccessContact, onErrorContact, options);
Here, im getting the contacts who are displayName is null.
I dont want this type of filter. I want to get all the contacts from this plugin. How can i change the filter.
Upvotes: 1
Views: 4279
Reputation:
var options = new ContactFindOptions();
options.filter = "";
options.multiple = true;
The Contacts Plugin is poorly documented. My notes are here:
http://codesnippets.altervista.org/documentation/phonegap/plugins/navigator.contacts.docs.html
Working App Here:
http://codesnippets.altervista.org/examples/phonegap/demos/PUBLIC.Apps.html
Upvotes: 1
Reputation: 98
There are some contact properties for this plugin, for example you can use id, name, nickname. Here the documentation where you can find it: http://docs.phonegap.com/en/edge/cordova_contacts_contacts.md.html
For example:
options.multiple = true;
var fields = ["nickName","phoneNumbers"];
navigator.contacts.find(fields, onSuccessContact, onErrorContact, options);
And a example with a options filter:
options.multiple = true;
var fields = ["nickName","phoneNumbers"];
options.filter = "Robert";
navigator.contacts.find(fields, onSuccessContact, onErrorContact, options);
I hope you find them useful.
Upvotes: 0