I have an Ionic2 app that I would like to add GooglePlus Authentication to.
I get the following error:
As far as I understand, it's because I have not set up a redirect_uri.
Question
What redirect_uri (Authorized redirect URIs) should I use for an Ionic2 app? Where do I find it?
The following works with Facebook login.
UPDATE
Following these instructions, I changed the REVERSED_CLIENT_ID to the following format:
"com.googleusercontent.apps.uniqueId"
So I think I have made progress.
I now get the following error in iOS:
From reading here, this means that the credentials should not be created for a Web Application here. But if I create it for iOS, how will this work for Android? Or does Android not make use of these credentials anyway?
For Android, when I try to log in, I just get an exception with an undefined error message.
So I have two questions please:
- Do I need to create
iOSclient ID here instead of aWeb application?
- How do I configure or debug this for
Android?
UPDATE
For iOS I added an iOS Client Id and changed my REVERSED CLIENT ID to match, and like with Android, it prompted me to sign into my Google Account. So that looks like further progress.
However, once I sign in, like with Android now I get an exception with the message as undefined. In the Xcode console, however, I do get the following:
com.google.HTTPStatus error 400.
Following these, I have now created credentials for both iOS and Android.
I have configured Android and iOS IDs in the new IDs.
I get an exception with the message as undefined on both Android and iOS.
UPDATE
Got it working for iOS. The webClientId option when you call login must not be the reversed client id, but rather the client id.
GooglePlus.login({
'webClientId': 'xxxxx.apps.googleusercontent.com',
'offline': true
}).then(googleData => {
Now to figure out why Android doesn't work.
In Android, I now get error = 12501 (which is a result of something wrong with my Keystore I think).
UPDATE
I generate the Keystore. As per these instructions, I copy the SHA1 to the Signing-certificate fingerprint. But still get error = 12501.






