I have used following code to fetch the Contacts and the Contact details using contact plugin, "cordova-plugin-contacts"
var options = new ContactFindOptions();
options.filter = "";
options.multiple = true;
var fields = ["*"];
navigator.contacts.find(fields, onSuccessContact, onErrorContact, options);
But I was not able to fetch the event dates like
How to get these fields?
Contacts plugin will return only few fields, refer https://github.com/apache/cordova-plugin-contacts#properties
And some properties supported in android, are not supported in ios device. refer device specific quirks https://github.com/apache/cordova-plugin-contacts#android-2x-quirks
You can get fields like birthday, displayname, id, phoneNumbers. But there is no support for fields of type anniversary,custom etc. You can get user-defined categories associated with the contact using categories field.
// find all contacts with 'Bob' in any name field
var options = new ContactFindOptions();
options.filter = "Bob";
options.multiple = true;
// Contact fields to be returned back.
options.desiredFields = [navigator.contacts.fieldType.id, navigator.contacts.fieldType.birthday];
options.hasPhoneNumber = true;
var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
navigator.contacts.find(fields, onSuccess, onError, options);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With