Ionic Native Contacts crashes upon saving Contacts

Hi all,

Ionic Native Contacts
https://ionicframework.com/docs/native/contacts/

I’ve tried the following (official) template code. The app on the latest android version crashes when a contact has been saved: so the plugin does write the contact, but crashes the application itself instantly.

On github:
“This plugin is being deprecated. No more work will be done on this plugin by the Cordova development community. You can continue to use this plugin and it should work as-is in the future but any more arising issues will not be fixed by the Cordova community.”

I Used this code:

let contact: Contact = this.contacts.create();

contact.name = new ContactName(null, 'Smith', 'John');
contact.phoneNumbers = [new ContactField('mobile', '6471234567')];
contact.save().then(
  () => console.log('Contact saved!', contact),
  (error: any) => console.error('Error saving contact.', error)
);

Is there a way to avoid the crash?
If there is no way, is there another plugin to use?

I think this is a really important plugin for a lot of users - hope someone can come up with a solution.

Thanks in advance,
Astrix

I’d recommend you to use the “vanilla” cordova plugin since this plugin hasn’t been working for me in ages.

Hey there!

Thank you for your answer!

Native Contacts Plugin only crashes the latest android devices to be exact (been deprecated since december 2017).

What code would you use then to save a contact?

Thank you in advance,
Astrix

Any further news? I’d really love to hear about a solution, bc a deadline is incoming…