Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. SaveToContact(phone, name) {
  2. try {
  3.  
  4. let contact: Contact = this.contacts.create();
  5. contact.name = new ContactName(null, name, '');
  6. contact.phoneNumbers = [new ContactField('mobile', phone)];
  7. this.global.presentToast('Will Save!'),
  8. contact.save().then(
  9. () => this.global.presentToast('Contact saved!'),
  10. (error: any) => this.global.presentToast('Error saving contact: No Permission')
  11. );
  12. } catch (e) {
  13. this.global.presentToast(e);
  14. }
Add Comment
Please, Sign In to add comment