Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7605

navigator.contacts.pickContact does not return on cancel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • 3.7.0
    • None
    • Plugin version : 0.2.13
      Xcode : Version 6.0.1 (6A317)
      Cordova : 3.5.0-0.2.7
      iOS 7.1.2

    Description

      Choosing the "Cancel" option on the contact picker fails to process either contactSuccess or contactError callbacks.

      Steps to reproduce :

      Trigger contacts picker. Tap the "Cancel" button. App receives no callback for a success or failure.

      NOTE: When opening picker, get this exception:

      Exception - Name: NSRangeException Reason: *** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array

      After opening the picker the first time and choosing Cancel, the picker will no longer open.

      Sometimes, when opening the picker the first time or another time after trying repeatedly, this exception shows:

      Warning: Attempt to present <CDVContactsPicker: 0x17ecd9e0> on <MainViewController: 0x17e1dcf0> while a presentation is in progress!

      Sample Code:

      navigator.contacts.pickContact(
        function(contact){
          console.log("In service. selected contact=");
          console.log(contact);
      
          selectedContact = formatContact(contact);
      
          deferred.resolve( selectedContact );
        },function(err){
          console.log("Error");
          console.log(err);
          deferred.reject();
        }
      );
      

      Attachments

        Activity

          People

            shazron Shazron Abdullah
            jnoel Justin Noel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: