Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova-plugin-contacts-Not get all event dates

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

  1. Anniversary
  2. Custom
  3. Others

How to get these fields?

like image 637
Tojo Paul Mangaly Avatar asked Oct 18 '22 21:10

Tojo Paul Mangaly


1 Answers

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);
like image 198
bvakiti Avatar answered Oct 22 '22 09:10

bvakiti