Open lessadiogo opened 9 years ago
Hey,
We have the same problem with Google login:
Does anybody have an idea (I buy you a beer when in Belgium!)?
/Frank
Hi Frank,
I solved it passing the second login argument 'offline': true. (Be sure you're using quotation marks)
See details here: https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/111
Hope it helps.
Hi,
When I add the 'offline': true argument then I get "Failed to retrieve token: Unknown" error.
@danicastanos , have u created credentials in your google developers console for the app? In plugin descriptions you can find more details.
if I use 'offline': true I am getting "Failed to retrieve token: Unknown" error. as @danicastanos said I have configured the app in developers console
The problem is that this plugin must show all data, but only show email???????? Can you please help ?
+1
+1
If the app shows only email, that means that you deployed the app on the device from another computer than the one who created the SHA-1 key. When creating an OAuth 2.0 client ID, you must enter a SHA-1 key generated using the keytool found on your computer, if it only returns email, that means it's not your key, and you should create your own for development. It's an important point to keep in mind when publishing a release version! Try it out, it worked for me
thank you @ChristopheDaVinci work for me :100:
@ChristopheDaVinci then what if we build the app using build.phonegap.com what can we do for that ?
then what if we build the app using build.phonegap.com what can we do for that ?
@Dineshrajaa That shouldn't make any difference. In phonegap build you also have to provide your signing key. Just create the SHA1 fingerprint for this key as described in https://developers.google.com/android/guides/client-auth
Thank you @phw and where should I place this "google-services.json" while building the app online?
@Dineshrajaa AFAIK you don't need this file. At least I never added that file to my cordova project, Google Signin uses the app package name and certificate fingerprint to get the correct credentials. Please correct me if I'm wrong, but it works for my app without ;)
oh thank you @phw will check and let you know :)
i have the same issue , i am getting only the email. after seeing this page, I set offline : true, but i get error: Failed to retrieve token:Unknown
I solve this problem enabling Google+ API
at Google Developers Console
.
I have the google+ API enabled. Still getting only the email.
@pvharikrishnan Did you create the credential?
I follow these steps:
keytool -exportcert -alias androiddebugkey -keystore <path-to-debug-or-production-keystore> -list -v
Hello mates,
I really need help because I've tried everything I found but still getting "Failed to retrieve token:Unknown" error.
I followed the "Get a configuration file" step in https://developers.google.com/identity/sign-in/android/start where I specified the Application package name copied from AndroidManifest.xml, and the SHA-1 I got using "keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore". After Google Sign-In was enabled sucessfully I can see google has created automatically an API key and a OAuth 2.0 Client ID in the Console, and they looks correct for me.
Then I built my project using "ionic build android" (I'm using Ionicframework) and installed the android-debug.apk on the real device. When window.plugins.googleplus.login({}) is called it shows correctly the sign-in dialog but in the end I only get a JSON object with email. If I add "offline" = true in the option it shows "Failed to retrieve token:Unknown" error.
I've tried the following so far but still can't get it work:
I also have Google+ API enabled.
Please help and thanks very much!
Hi again I finally resolved my problem which was stupid. I actually pasted the wrong SHA1 lol
Notice that as google uses the certificate of your app for verification purposes, in order to get the complete profile you need to use a signed app. In my case I was only obtaining the email because I launched the app directly with Eclipse and so it wasn't signed. Once I realized the signature was needed and installed a signed app, I correctly got the complete profile.
Can someone elaborate on the process what should be done to receive all the details of the user.? I think that would be helpful for many.
@gowthamravichandran please check vmlellis comment he has elloborated it
For everyone who have the same problem, after changing my app's package name and apply the SHA-1 fingerprint in the Google Developers Console. What worked for me was:
The package name of my production app was something like com.what.myapp123238. The other OAuth ID was: com.what.myapp123238Staging.
I've changed to com.what.Stagingmyapp123238 and it works.
It seems suffixes are not interpreted well by Google.
Hello guys,
This solved my issue of getting only user email id.
The above screenshot appears when you create a project -> Enable Google API -> Go to credentials -> Select the radio button user data
Complete the process & you will get all the userdata.
@All - If you get only email obj then you need to make sure your SHA fingerprint in local app keystore matches with one added to https://console.developers.google.com (Credentials). If it is different you will only get email in (obj).
Hi, i see many people with the issue of only email is being retrieved, this is fixed by making sure that both the package name AND the SHA1 are properly set on https://console.developers.google.com. go to API Manager->Credentials and update your API info. you can retrieve your package name from your config.xml file and/or your androidmanifest.xml file.
Hello,
Is there anyone who can help me with this issue?
I have tried every solutions given here by you all, but only getting email of the user.
Please help me.
I am using MAC, Cordova and IONIC framework.
@RahulMiglani Please double check credentials in Google Console, eg Does package name matches the one in config.xml? Does the SHA-1 certificate matches your debug.keystore?
@RahulMiglani I had the same issue as you, this is fixed by making sure that both the package name AND the SHA1 are properly set on https://console.developers.google.com. go to API Manager->Credentials and update your API info. you can retrieve your package name from your config.xml file and/or your androidmanifest.xml file. you need to double check all your steps. I had the same issue and this fixed it for me.
To get the android debug.keystore SHA1 you may run from anywhere
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@odindarkester @RahulMiglani Hello,
Your issue probably about non signed apk so you should generate signed apk (With keystore which is you create for Google+ API Client ID) for correctly get all information of users.If you haven't created one yet.
Thanks.
Try without any options, just the googleplus.login({},function(){alert("yay"0;},function(){alert("boo");}) It doesn't even need the key or anything.
I got the SHA1 signature using this command (which was my user id):
keytool -exportcert -keystore ~keytool -exportcert -keystore ~/.android/debug.keystore -list -v
While doing the build, I used sudo:
sudo ionic run android
Since sudo ran as root, a different keystore was used and hence a different SHA1 signature.
It worked once I did the build without sudo, i.e. "ionic run android"
I get this issue with iOS
. iOS
does not use a keystore
.
I do have an iOS Credential
set up with the Bundle ID
matching the widget id
in the config.xml
.
I have also created a Firebase App
for my Project that also has the matching Bundle ID
(not sure if this has any effect).
When I do this:
GooglePlus.login({
'webClientId': webClientId,
'offline': true
}).then(googleData => {
The webClientId
matches the Client ID
in the iOS
Credential.
Hi, Eddy.
Congratulations for the great job. I'm in a issue, when I call the login action, success callback only retrieves me the user email, but not the others informations, like imageUrl, displayName and userId.
I don't know if it can be some problem with certificate fingerprint or other setup configuration.
Hope u have some idea about that.
Thanks, Diogo