Cordova-plugin-contacts - Do not receive all event dates

I used the following code to retrieve contacts and contact information using the cordova-plugin-contacts contact plugin

var options = new ContactFindOptions(); options.filter = ""; options.multiple = true; var fields = ["*"]; navigator.contacts.find(fields, onSuccessContact, onErrorContact, options); 

But I was not able to get the dates of the event, for example

  • Anniversary
  • Custom
  • Other

How to get these fields?

+5
source share
1 answer

The Contacts plugin will return only a few fields, see https://github.com/apache/cordova-plugin-contacts#properties

And some properties supported in android are not supported on the ios device. refer to device specific features https://github.com/apache/cordova-plugin-contacts#android-2x-quirks

You can get fields like birthday, display name, id, phoneNumbers. But there is no support for fields such as anniversary, custom, etc. You can get user-defined categories associated with a contact using the category 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); 
+3
source

Source: https://habr.com/ru/post/1260966/


All Articles