×

Discussion Board

Results 1 to 5 of 5

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    11

    Google Contact API in S40 web app

    Hi,
    I am trying to access my gmail contact list through Google Contact API by JavaScript.
    But i am not able to get the authentication for my application.
    Getting error
    The next parameter was missing or bad.
    Any suggestion would be appreciated.
    Thanks in Advance.

  2. #2
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: Google Contact API in S40 web app

    Give us some code to work with or nobody will be able to help you.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    11

    Re: Google Contact API in S40 web app

    Here is my Code
    <script type="text/javascript" language="javascript">
    google.load("gdata", "1.x");
    google.setOnLoadCallback(initFunc);
    var contactsService;

    function setupContactsService() {
    contactsService = new google.gdata.contacts.ContactsService('GoogleInc-jsguide-1.0');
    }

    function logMeIn() {
    var scope = 'https://www.google.com/m8/feeds';
    var token = google.accounts.user.login(scope);
    }

    function logMeOut() {

    var scope = 'https://www.google.com/m8/feeds';
    if (google.accounts.user.checkLogin(scope)) {
    google.accounts.user.logout();
    }
    }


    function initFunc() {
    setupContactsService();
    logMeIn();
    getMyContacts();
    logMeOut();
    }

    function getMyContacts() {
    var contactsFeedUri = 'https://www.google.com/m8/feeds/contacts/ziaur18@gmail.com/full';
    var query = new google.gdata.contacts.ContactQuery(contactsFeedUri);

    // Set the maximum of the result set to be 5
    query.setMaxResults(500);

    contactsService.getContactFeed(query, handleContactsFeed, handleError);
    }

    var handleContactsFeed = function(result) {



    var entries = result.feed.entry;

    var t = "Contacts List <table border = 1 align = center width = 50%>";
    t = t + "<tr><td align = center>Name</td><td>Email Address</td></tr>"; //row1

    for (var i = 0; i < entries.length; i++) {
    var contactEntry = entries[i];
    var emailAddresses = contactEntry.getEmailAddresses();
    var name=contactEntry.getTitle().getText();

    for (var j = 0; j < emailAddresses.length; j++) {
    var emailAddress = emailAddresses[j].getAddress();
    t = t + "<tr><td align = center>"+name+"</td><td>"+emailAddress+"</td></tr>";
    }
    }

    t = t + "<table>";

    document.getElementById("showhide").innerHTML = t;
    }

    function handleError(e) {
    alert("There was an error!");
    alert(e.cause ? e.cause.statusText : e.message);
    }


    </script>

  4. #4
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Google Contact API in S40 web app

    Hi,

    I briefly checked Contacts API documentation and it states that OAuth 2.0, is used for authentication.
    Unfortunately OAuth 2.0 is not supported in series 40 web apps and for OAuth 1.0 you would have to use a proxy to handle authentication flow.
    http://www.developer.nokia.com/Commu...es_40_Web_Apps

    Br,
    Ilkka

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    11

    Re: Google Contact API in S40 web app

    Hi Ilkka,
    Thanks for you help.

Similar Threads

  1. Replies: 5
    Last Post: 2009-06-23, 12:43
  2. Replies: 3
    Last Post: 2008-12-10, 08:54
  3. Replies: 10
    Last Post: 2008-06-05, 13:36
  4. Replies: 5
    Last Post: 2006-10-12, 13:38
  5. Replies: 3
    Last Post: 2006-10-09, 12:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×