Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

$cordovaContacts not working for android v4 #1441

Open
varepato opened this issue Aug 22, 2017 · 0 comments
Open

$cordovaContacts not working for android v4 #1441

varepato opened this issue Aug 22, 2017 · 0 comments

Comments

@varepato
Copy link

I have a button for picking contacts. The code works in android 5 to 7 but fails in android 4. This is a piece of the code:

$ionicPlatform.ready(function () {
    contactService.initService();
    vm.contacts = contactService.contacts;
    vm.pickUpContact = pickUpContact;
  });

 function pickUpContact(index) {
    $cordovaContacts.pickContact().then(function (contactPicked) {
      console.log(contactPicked);
    });
  }

I tried using the navigator.contacts.pickContact() but i get:
ContactError.OPERATION_CANCELLED_ERROR (code 6)
Maybe the code isnt working becouse when pickContact is called the app gets paused. In the cordova plugin repo, they recommend to wrap the returned object in a Contact object before using it, If the plugin returns its result in the resume event. But the ionic resume event isn't returning any result.

Help please!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant