Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google+ SignIn Button with PhoneGap

How can we use the JS Google+ Signin button with Phonegap? Specifically for iOS? I have found this article on doing oauth with phonegap and the childbrowser plugin however I'm not sure that approach will work with the Google+ signin button. Any Ideas?

like image 329
Patrick Avatar asked Apr 19 '13 16:04

Patrick


1 Answers

The Google+ Sign-In button won't work for you in PhoneGap because of how Phonegap serves content (basically its treated as file://) and that leads to a few problems that relate to either the button itself or to the API Console config.

What you'll want to do is to use an OAuth plugin for PhoneGap and treat your phonegap app as an "Installed application." I did a quick glance through the following tutorial and it appears to be an accurate set up and process:

http://www.itsalif.info/content/oauth-google-api-gapi-phonegap-childbrowser-jquery

You can still request the Google+ Sign-In scope (https://www.googleapis.com/auth/plus.login) with this approach and take advantage of most of the new Google+ features.

I will be interested to learn if you get this working, so please comment later if you are successful.

like image 174
BrettJ Avatar answered Sep 23 '22 11:09

BrettJ