Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9113439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:57:53+00:00 2026-06-17T03:57:53+00:00

I have this posted on PhoneGap google groups and cross-posted it here on Stack

  • 0

I have this posted on PhoneGap google groups and cross-posted it here on Stack Overflow.

Anyway, PhoneGap’s Contact API is giving me headache lately. To cut it short:

Environment

  • iOS 6
  • PhoneGap 2.0.0

I have this application that scans a QR code with VCard embeded, and it will save it into user’s contact once the user agree to save it down. On Android 4.1.2, this piece of code works flawlessly without any error, and contact was saved too. On iOS 6, however, I can’t get it to work. What I have always receive is error #4, which is, ContactError.IO_ERROR.

The code is as below:

navigator.notification.confirm('Found a contact: "'+(vcard['N'] || '')+'". Add it into your contact list?', function(btn) {
    if (btn == 1) {
        var contact = navigator.contacts.create();

        contact.displayName = vcard['N'] || '';
        contact.emails = [new ContactField('email', vcard['EMAIL'] || '')];

        var org = new ContactOrganization();
        org.name = vcard['ORG'] || '';

        contact.organizations = [org];


        contact.save(function() {
            navigator.notification.alert('Contact Saved');
        }, function(err) {
            navigator.notification.alert('Error on saving contact: '+err.code);
        });
    }
}, 'QR Code Scanner', 'OK,Cancel');

And below is the only log I have seen on XCode right after I tap on ‘OK’: (first callback is for the notification.confirm)

2012-10-22 21:19:24.619 [11897:907] PluginResult:toJSONString - {"status":1,"message":1,"keepCallback":false}
2012-10-22 21:19:24.621 [11897:907] PluginResult toSuccessCallbackString: cordova.callbackSuccess('Notification12',{"status":1,"message":1,"keepCallback":false});
2012-10-22 21:19:24.738 [11897:907] PluginResult:toJSONString - {"status":9,"message":4,"keepCallback":false}
2012-10-22 21:19:24.739 [11897:907] PluginResult toErrorCallbackString: cordova.callbackError('Contacts13',{"status":9,"message":4,"keepCallback":false});

Then I will see the alert:

Error on saving contact: 4

Note

  • vcard is a key-value pair of vcard obj. Please ignore this for now. It’s not important.
  • This piece of code works fine on android.

Is this the correct way of creating contact? How can you save a contact on iOS 6 using PhoneGap?

Edit

I did all the necessary migration and upgraded to v2.1.0, but the error code still emerges. Why is this?

Edit

Apparently this has something to do with the new AddressBook permissions request on iOS 6 as mentioned by Mark, but no one has answered me on how to do it properly. Spent some times on research I came to a conclusion that it’s best if we can just wait for Phonegap to finish up v2.2 as I saw permission request being added in CDVContacts.m in v2.2 rc2 commit 61857860…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:57:54+00:00Added an answer on June 17, 2026 at 3:57 am

    i’ve had the same problem. As it turns out, i was using phonegap version 1.9, which did not support iOS 6, therefore adding a contact gave me Error 4 message all the time. To fix this, i upgraded to phonegap version 2.1. This version supports iOS 6 as well as both armv6 and armv7 architectures. The error message was because iOS 6 requires permissions to access the address book, in the same way that using the GPS requires permission on iOS. This should solve your problem, it did for me 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[I have posted this at the Django users | Google Groups also.] Using the
I'm asking this question because I have gone through the tutorial posted here: Preventing
I've crossed posted this in the FNH Google Group but here's the scoop: I
I have posted this on the Google Web Toolkit Discussion Group but hopefully you
I have seen this question posted here, but always, the answer is that the
I have this posted here: https://getsatisfaction.com/pixelandtonic/topics/wygwam_not_styled_in_cp_entry_and_not_functioning_shown_errors_attached ...but I really need a fix asap if
Greetings all, I have posted this on the MSDN managed news groups as well
I have seen this code posted here on StackOverflow: with TDownloadURL.Create(nil) do try URL
I am a PHP developer and I wouldn't have posted this question here if
im sorry if this was posted already i have been looking to no avail..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.