Search code examples
androidcordovaoauthparse-platformgoogle-oauth

How to use Google Login API with Cordova/Phonegap


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.


Solution

  • Since April 20th 2017 use of the In-App browser as described in Deep Mehta's answer is no longer supported. If you use this, it is going to fail since it is no longer supported. You can read Google's post about the change.

    Luckily there's a new plugin (see it on github or NPM) that wraps up all the functionality that you need to do this. Here's also an article on how to use it in Ionic 1 and 2.

    Again - do not use Deep Mehta's answer! It will fail after April 20 2017.