I am using this plugin, In Android, it works fine, whereas in IOS also for the first time I am getting all the contacts.
But the catch is, in IOS if I go to phone settings and disable the permission for contacts and come back to app, since I do not have the permission, ideally it should go to the error block of promise, but it doesn't go.
But, If I want to filter contacts based on search term in the code, and now in the app settings if I disable the contacts permission, then, it goes inside the error block of the promise, which takes care of showing the error.
Irrespective of search term, I should get the contacts If permission is enabled and if permission is disabled, it should go inside error block of promise (So, that i can show to the user that "You do not have access"). Any quick help is much appreciated. Thanks.
Hi Jonothan Solomon,
I am using this plugin, In Android, it works fine, whereas in IOS also for the first time I am getting all the contacts.
But the catch is, in IOS if I go to phone settings and disable the permission for contacts and come back to app, since I do not have the permission, ideally it should go to the error block of promise, but it doesn't go.
Sample Code (Which does not work in IOS)
Contacts.getContacts(this.desiredFields).then( (result: Array<ContactLiteObject>) => { this.result = result; } }, e => { this.emitRes(); console.dir(e); } );
But, If I want to filter contacts based on search term in the code, and now in the app settings if I disable the contacts permission, then, it goes inside the error block of the promise, which takes care of showing the error.
Sample Code (Which works in IOS)
Contacts.getContacts(this.desiredFields, 'Kate', true).then( (result: Array<ContactLiteObject>) => { this.result = result; } }, e => { this.emitRes(); console.dir(e); } );
Desired Result:
Irrespective of search term, I should get the contacts If permission is enabled and if permission is disabled, it should go inside error block of promise (So, that i can show to the user that "You do not have access"). Any quick help is much appreciated. Thanks.