Contact Picker

3 posts, 0 answers
  1. Patrick
    Patrick avatar
    2 posts
    Member since:
    Oct 2013

    Posted 14 Oct 2013 Link to this post


    How to get access and open the contact data (Addressbook) by clicking on a button.
    Pick a contact from the contact list and send it to an input field

    Can someone please help me.


  2. Patrick
    Patrick avatar
    2 posts
    Member since:
    Oct 2013

    Posted 15 Oct 2013 Link to this post

    This is my code:

    function onDeviceReadyContacts() {
    // find all contacts
    var options = new ContactFindOptions();
    options.filter = "";
    options.multiple = true;
    var filter = ["*"];
    var fields = ["displayName", "name"];
    navigator.contacts.find(fields, onSuccess, onError, options);

    function onSuccess(contacts) {

    var element = document.getElementById('cont');
    for (var i = 0; i < contacts.length; i++) {
    console.log("Display Name = " + contacts[i].name.formatted);
    element.innerHTML = '<li><a href="#">' + contacts[i].name.formatted + '</a></li>';

    Uncaught TypeError: Object #<Object> has no method 'find'
  3. Steve
    Steve avatar
    10941 posts

    Posted 18 Oct 2013 Link to this post

    Hello Patrick,

    Opening the AddressBook is not supported in Cordova out of the box. There are some custom Cordova plugins out there (like this one), but they target an old Cordova version and are not plugman compatible. Also this one is for Android only and it doesn't seem to be iOS version.

    Otherwise, the code looks correct and the error you get could be caused by either:
    • not referencing cordova.js in your html page that triggers the javascript
    • by removing the Cordova Contacts API from your project file.

    If you're still having problems, please build your app so that it is uploaded to our cloud and also attach your proj file to this thread (you can rename it as .txt).

    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top