How to use the @ionic-native/contacts.ContactField function in @ionic-native/contacts

To help you get started, we’ve selected a few @ionic-native/contacts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github janpio / ionic-native-contacts / src / pages / home / home.ts View on Github external
addContact(): void {
    let contact: Contact = this.contacts.create();
    contact.name = new ContactName(null, 'Smith', 'John');
    let number = new ContactField('mobile', '6471234567');
    contact.phoneNumbers = [number];
    contact.save().then(
      () => console.log('Contact saved!', contact),
      (error: any) => console.error('Error saving contact.', error)
    );
  }
github zyra / ionic-native-playground / src / pages / contacts / contacts.ts View on Github external
createContact() {

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

    contact.name = new ContactName(null, 'Smith', 'John');
    contact.phoneNumbers = [new ContactField('mobile', '6476476477', true)];

    contact.save()
      .then(v => this.result = v)
      .catch(v => this.error = v);

  }

@ionic-native/contacts

Ionic Native - Native plugins for ionic apps

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis

Similar packages