Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SaveToContact(phone, name) {
- try {
- let contact: Contact = this.contacts.create();
- contact.name = new ContactName(null, name, '');
- contact.phoneNumbers = [new ContactField('mobile', phone)];
- this.global.presentToast('Will Save!'),
- contact.save().then(
- () => this.global.presentToast('Contact saved!'),
- (error: any) => this.global.presentToast('Error saving contact: No Permission')
- );
- } catch (e) {
- this.global.presentToast(e);
- }
Add Comment
Please, Sign In to add comment