Open consrvinfotech opened 8 years ago
Same here. Only getting email in the response. It also doesn't show the Oauth page I customized on the Api manager and the app doesn't appear on the list of connected apps & sites on my Google account.
Same here, if i pass '{}' to login function i get only email. If i pass a list of scopes it's returning 'no valid token'.
@ricardocarvalh0 @axelingadi @consrvinfotech 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.
Hi @ahmetakin,
The apk is signed and is on the play store. I am using the same sha I used for the play store for the Google + API. Is this ok?
Hi again @axelingadi ,
Api and Apk package names need to be same.Are they same?
@ahmetakin yeah they are the same. Same SHA same package name. What's different though is the google accounts. The developer account that I created the credentials for the Google + API is different from the account I use to upload the apk to the play store. Could this be the problem?
@axelingadi if you use 2 different account for Google Developers console and Google Play Developer Console give permission each other.
I was getting only email id but later figured out that I am missing one step - https://developers.google.com/identity/sign-in/android/start-integrating#prerequisites
click on this link and click Get Configuration File button. Then follow the steps and Enable Google Signin.
Pass the scope parameter as {email profile }
window.plugins.googleplus.login( {scopes: 'profile email'}, function (user_data) { alert("user_data : " + JSON.stringify(user_data)); }, function (msg) { alert("error : " + msg); } );
I already enabled google signin, but anyways i recieved always the email.
I had the same thing now, you need to add {scopes: 'profile email'} if that doesnt work for you, look at the package name, I had also 1 capital letter by mistake. and another thing that you can do is also set 'offline': true window.plugins.googleplus.login( { 'scopes': 'profile email', 'offline': true } and then to use the token you receive for approaching other APIS. if you dont receive authToken when sending 'offline': true then you didnt do one of the steps correctly.
take a look at this as well: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#signing-an-app to make sure all environment is setup correctly.
Good luck.
I tried All these steps after that facing the same issue.
Hey @Rajnishkumar184, @consrvinfotech, @axelingadi, @ricardocarvalh0, @ahmetakin, @rajeshkumarbehura, @Mdpproduction, and @odedkeren1, thanks for pointing this out!
I just merged a significant update yesterday that updated the Android side to use Google Sign-In and refactored plugin usage. The current documentation is up to date with those changes. You should check it out. Let me know if y'all have any questions!
Note that you need to pass an options object in, even if it's empty ({}). The default scopes are Profile and Email.
Happy Coding, ~Sam
P.S. Close this issue if you're good to go!
@sammuggPS The update fixed this issue for me. Works like a charm. Thanks!
@sammuggPS, issue is fixed now and working fine. Thanks
Not, for me. It's saying "ERROR: NO VALID TOKEN"
@shynka,
Did you update the plugin using the GitHub Url or the npm registry? Did you remove the plugin from your platforms before reinstalling?
If not, please try both of those things and get back to me.
~Sam
I've been trying for a few days now, remaking the demo app, remaking the credentials, redoing everything. The farest I've gotten is getting just the email.
@Shynka, 1) Could you please answer the questions from my first reponse? 2) Could you post a snippet of how you are calling the googleplus.login method?
Sorry, I have tried installing it from github threw the tutorial
@Shynka, Again, please answer my questions. I need more info in order to be of any help.
I Created a new phonegap app replaced the index.html with the one in github got the plugin using "cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus"
Ran "cordova platform add android" then "cordova prepare" then "cordova build" Installed it with Gapdebug And Clicked "Login with Google+" my accounts pop up and sometimes it shows just my email, and sometimes it shows "ERROR: NO VALID TOKEN"...
I also did all the sha1 things, but when I look in the usage quote, nothing shows up
I fixed it by releasing the build... which wasn't mentioned any where
@Shynka, Can you elaborate on what you mean by that?
(P.S. Sorry I wasn't able to get back to you again earlier; got busy with some other stuff)
I was able to get the demo app to get an error code 12501 which is the unsigned error code. So I when to the build phonegap site and build it as a release with the keystore from the tutorial. After installing it all worked perfectly.
Ah I see. Very interesting! Glad you got it working and picked up on that nuance.
using signed apk solved my problem
getting "error: 10" message in android
I am using latest version of the plugin i.e 4.0.8. On Android, after successful loin getting only email id in the response. Need display name also in the response.