Open cpup22 opened 7 years ago
have you fixed that ?
I'm getting this on Android as well. I've tripple checked (and then some) that I've followed the instructions but I have to say that they're a bit confusing.
Here's what I've done:
I've basically been trying all combinations of what might be described on the Readme but not matter what I do I get a 12501 error code when I try to log in with Android.
On iOS I can login to Google in the window that loads up and allow permissions to the application but I get a 400 error then when the window closes.
Any clarification on what I'm doing wrong would be greatly appreciated!
@JohnMcAvinue Exactly the same here. I tried all possible combinations in mind.
@JohnMcAvinue I'm also getting 12501 (SIGN_IN_CANCELLED) error. Maybe it doesn't work with the firebase authentication?
@ilkkanisula That could well be it. You would think the developer would indicate if this is the case though. Have you tried it with the old way?
This plugin does about the same but uses some firebase sdk methods also: https://github.com/blakgeek/cordova-plugin-firebase-auth-google/blob/master/src/android/com/blakgeek/cordova/plugin/FirebaseAuthPlugin.java
I created new clients for Android and Web Application in Google Credentials Manager (not Firebase) and tried with those but still getting a 12501. This is almost certainly an issue with the plugin or documentation as I cannot get it to work
Anyone got this working yet?
Nope, i had to use the "web" way of doing that.
If anyone wants to jump over this issue and implement he "web" way of getting this done, for futher work on the real solution just hit me and i'll help, or post a demo working properly.
But i want to say that im starting to think this native G+ SignIn will work only after signing the app and sending it to production/publishment.
I've luckily been able to park this feature for now, and am hoping the developer can come back to help us with this until I actually need it. No point in doing the Web way cos Google are depreciating it in a few months
@JohnMcAvinue What? Google cant deprecate the web G+ Sign In. What i heard, and indeed the Google did, was not allowing a webview handle signin procress anymore. But i could get around this easily. It does not make sense remove the web signin cause sites will still have this feature on.
@SilvaCoder Yes I thought you were talking about OAuth using InAppBrowser which is being depreciated
But im using InAppBrowser with Crosswalk without webview in order to make it work. But yes, the normal procress with InAppBrowser is deprecated, but like i said i could get around this and its working pretty well, cause the only thing that Google did was upload a file, and actually webviews cant handle that, thats how they broke the old normal procress. For now is better than nothing, but im still working in the real solution.
I have also tried to sign in the app with production key and it's still not working properly.
EDIT:I take it back. I ran the same release signed app again after an hour and it started to work. So it seems there is delay in adding a SHA key to google auth. Now It's working and I get back object with
{ email: ..., idToken: ..., diplayName: ...}
@ikkanisula Thanks for response ! I'll not jump directly to it then.
So now it's working fine. You need to sign your app with release key using commands:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -storepass PASSWORD -keystore your.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk release
zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk android-release-signed.apk
I'm using ionic cloud to build and have used my release keystore but it doesn't work.
You would imagine using that would mean it's signed?
John
On 25 Jan 2017, at 19:49, ilkkanisula notifications@github.com wrote:
So now it's working fine. You need to sign your app with release key using commands:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -storepass PASSWORD -keystore your.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk release
zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk android-release-signed.apk — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Make sure your release SHA1 is the same as what you've used in the Developers Console to set up your project.
I'm 100% certain it is and the package name matches. See what I've tried a few posts up.
John
On 25 Jan 2017, at 20:13, Sam Muggleworth notifications@github.com wrote:
Make sure your release SHA1 is the same as what you've used in the Developers Console.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I managed to get it running did everything like documentation said it was bit tricky in developer console I created oauth web and android version. For android version I followed steps for SHA and package. After creating those two I installed plugin with reversed id of android version of app created in developer console. After installing the app in my .js file in webClientId I put ID of the web app created in google developer console and now it all works. Hopefully this helps.
Which keystore did you use for the SHA1?
Android debug keystore found in .android folder (on my mac)
So, just for settle down things about this issue. If you plan to make it work on debug you must sign the app with a labeled debug key and this key must be in firebase app on the place where you can put your cert fingerprint. And in order to make it work in production you must sign the app with a labeled release key and put it on developers console when publishing the app. Is this correct ?
Just wanted to add here that I was facing the same 12501 errors. I'm using Firebase and it appears that the generated "Web SDK configuration" code for Google Sign-In authorization there did not actually match up with what was in the onsole.developers.google.com OAuth 2.0 client IDs for Web Client. I took the Web Client ID from Google Credentials Manager and replaced the one in Firebase. Everything worked right away after that passing the same one to the plugin in my js.
You can automatically sign a Cordova app when running on your local machine with
cordova run android --release
and adding a build.json file next to your config. xml. If you want to commit this file you can leave out your keystore's passwords and popup will ask you to enter keystore and alias passwords.
i was able to get rid of error 12501.. please give the SHA-1 key correctly ...
1 : create an ionic proj. 2 : after that add the plugin and stuffs given by Eddy 3 : then create android platform and add keystore (if release build) or debug.keystore available in this path %USERPROFILE%/.android/debug.keystore. 4 : google how to find SHA-1 in in debug mode and copy and paste in reqd. proj 5 : finally build apk and it wll work,..
I tried @Barathwaja steps and I still get 12501. I created a debug and a release keystore and then I created two separate projects in google console and neither works. I have re tried the process from start to finish 3 times and its still failing.
Double check that your project is actually building with the keystore you intend it to. Sometimes, especially when using Ionic and Phonegap, there is a separate debug keystore that overrides if you don't specify exactly which one to use.
Please be sure of SHA-1 coz if that's mismatched it will not work.. Am sure of that @Ross-Rawlins
Hey Guys someone in the cordova slack group told me to use the android client id and not the web client id once I swapped them then it all worked 100%;
Ok.. finally got it working after 2 hours. You need to use the reversed Android client key in the config.xml and the Web client (auto created by Google Service) key in the window.plugins.googleplus.login call ..
I've created 2 Android client keys in the Google API manager, one for Debug and one for Release, and change the reversed client key in config.xml depending on which version I'm compiling currently.
I fixed the problem by specifying the location of the keystore: https://www.webniraj.com/2016/11/21/cordova-changing-the-default-debug-keystore-for-android-applications/
Just to let you (and all following guys) know: I had the same problem because I didn't read the documentation of Eddy well enough. The SCOPES are SPACE SEPERATED, not comma seperated. This also results in 12501.
@reno77 solution works for me.
I noticed I can get the plugin working great on android and then I test/run/build my cordova app for ios (where it works fine on ios) then when I go to run/build on android I get the 12501 error. Only way to solve is to uninstall the plugin and reinstall. Which can be frustrating when developing for both platforms constantly having to uninstall/reinstall the plugin.