I want to use "Login with Google" in my Phonegap App. I have read many articles but couldn't find out how it is done. Thanks in Advance. I tried using oAuth2 for "installed Applications" as per this URL. But then the app users have to manually copy code and paste in my app. I am using built.io Federated Login, if its relevant.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Google has dropped support for the accepted answer above! After April 20th 2017 use of the In-App browser as described by @Deep Mehta will no longer be supported. If you use the accepted answer then it is going to start failing very soon.
Here's Google's post about the change: https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
Luckily there's a new plugin that wraps up all the funcitonality that you need to do this:
https://github.com/EddyVerbruggen/cordova-plugin-googleplus and on NPM https://www.npmjs.com/package/cordova-plugin-googleplus
Here's an article on how to use it in Ionic 1 and 2 also: http://blog.ionic.io/google-oauth-changes
Again - DO NOT USE THE ACCEPTED ANSWER! It will fail after April 20 2017.
Another implementation that works well here: https://github.com/valenzia10/PhonegapGoogleLogin
I recommend this cordova plugin: https://www.npmjs.com/package/cordova-plugin-googleplus It's pretty recent but I just added it to my app and it seems to do the trick!
add this code in one js file and include in your project. when you want to access google login api on button click call
function callGoogle()
rest will be done by this code. Dont forget to add your client id and Client_Secret keys. Its working fine for me. You need inappbrowser cordova plugin.