-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Plus login not work #5
Comments
Problem is when I click on button gPlusNetwork.isConnected() is true but I am not login with ! if is false.
But now I have |
@maksim88 This also not working in MainActivity... Any news for this bug? |
Hey, i'm currently investigating... |
In MainActivity I am put 2 button one for Fb and one for G+. When I click on fb button everything works fine. But when I click on G+ button nothing happen. I am run this on Emulator (Android 5, Android 6, Android 7) and on my real device which is Android 5. In all cases same story nothing happen. This is like a button with no events. |
Ok, so the button does not do anything because you are checking for the connection state (isConnected()) and GoogleApiClient returns true in that moment. I'll upload a new version to jitpack where you can test whether it works better for you. I made some changes to GooglePlusNetwork
in the connected state you can call silentSignIn() and get a token back. |
Yes, now this works... But when you logged you see button Sign In maybe this replace with button text LogOut... |
When you login with Fb and G+ in same time on Fb button you see LogOut but G+ button stay same text (Sign In). Now you go turn off your device and now you go turn on your device. On facebook you stay logged but on G+ you are not logged. |
Unfortunately the Google SignInButton does not handle its own state like the Facebook button does, that's why it is not possible. What I saw people do and what I actually liked when I looked at some projects is to call |
What you think about that idea. For example you go login with G+ and now in method onLoginSuccess() you have token, username, email save that in SharedPreferences and now you go turn off your device. Now you turn on your device in fragment in method onCreateView you invoke SharedPreferences data. If you have data you are logged. But now is question if you want to referesh your username or email token is outdatet. Do you have any method to give you new token if you not click on button. |
For example.... For facebook this work if you not logout and turn off/on your device
For google
|
I'll play around with it on the weekend and think about it |
Ok nice. When you will have new informations share it here 👍 |
Do you have any news :) |
I decided just to save the connection state in the SharedPreferences (because I do not like saving credentials in SP). Just check the sample project to see how I envision it to work. |
I will test now |
@maksim88 Perfect this works fantastic |
Hi,
When I click on login button on Google plus nothing happen. Do you know what is wrong
The text was updated successfully, but these errors were encountered: