Skip to main content

Contacts

Access and manage Contacts on the device.

https://github.com/apache/cordova-plugin-contacts

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation#

$ npm install cordova-plugin-contacts
$ npm install @ionic-native/contacts
$ ionic cap sync

Supported Platforms#

  • Android
  • BlackBerry 10
  • Browser
  • Firefox OS
  • iOS
  • Ubuntu
  • Windows
  • Windows 8
  • Windows Phone

Usage#

React#

Learn more about using Ionic Native components in React

Angular#

import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts/ngx';
constructor(private contacts: Contacts) { }
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)
);