From 961727ee6158b25cae88458cfecd7807175efdfe Mon Sep 17 00:00:00 2001 From: Ibby Hadeed Date: Tue, 28 Mar 2017 04:37:35 -0400 Subject: [PATCH] fix(contacts): handle cordova_not_found errors --- src/@ionic-native/plugins/contacts/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/contacts/index.ts b/src/@ionic-native/plugins/contacts/index.ts index 004970998..82cceeee7 100644 --- a/src/@ionic-native/plugins/contacts/index.ts +++ b/src/@ionic-native/plugins/contacts/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability } from '@ionic-native/core'; +import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck } from '@ionic-native/core'; declare var window: any, navigator: any; @@ -309,6 +309,7 @@ export class Contacts { * @param options {IContactFindOptions} Optional options for the query * @returns {Promise} Returns a Promise that resolves with the search results (an array of Contact objects) */ + @CordovaCheck() find(fields: ContactFieldType[], options?: IContactFindOptions): Promise { return getPromise((resolve, reject) => { navigator.contacts.find(fields, (contacts) => { @@ -321,6 +322,7 @@ export class Contacts { * Select a single Contact. * @returns {Promise} Returns a Promise that resolves with the selected Contact */ + @CordovaCheck() pickContact(): Promise { return getPromise((resolve, reject) => { navigator.contacts.pickContact((contact) => resolve(processContact(contact)), reject);