Has anyone had success in using the Gmail API's authorization in a Phonegap application? I found this (http://phonegap-tips.com/articles/google-api-oauth-with-phonegaps-inappbrowser.html) that describes using the generic Google API OAuth with Phonegap's inappbrowser plugin, but the newly released Gmail API does OAuth authorization differently, and I'm not sure how to get it to work with Phonegap.
Note: It does work when I try a web version of my app, but the button that brings up the authorization screen doesn't do anything in Phonegap..not sure why. I do have the appropriate Android credentials for the app in the Google Developer's Console.
UPDATE: Using OAuth's Phonegap SDK (found after registering your app here: https://oauth.io/), I am able to authenticate a Google Account. However, I am unsure how to then call Gmail API methods or correctly pass whatever authentication tokens from the OAuth SDK to any Gmail API code. Has anyone done this and can share their knowledge?
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult);
, which is different than thevar authUrl = 'https://accounts.google.com/o/oauth2/auth?' + $.param({client_id: options.client_id, redirect_uri: options.redirect_uri, response_type: 'code', scope: options.scope});
, the first having no url or uri redirect. I've tried callingwindow.open
on the gapi call, similar to this (github.com/mdellanoce/google-api-oauth-phonegap/blob/v0.0.1/www/…), but it didnt work – artis3n