Google+ SignIn Button with PhoneGap

老子叫甜甜 提交于 2019-12-19 06:46:21

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/16109762/google-signin-button-with-phonegap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!