How to use Google Login API with Cordova/Phonegap

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.

Leave a Comment