Why Does Google+ Login Accomplish Login With An Error?
Solution 1:
The reason is that that the device can't know whether you actually need to log in or not - sign in is really more like accessing a facility (as you might with location) than it is entering a username and password. The basic flow is:
- Connect to Google Play services, see if the app has been authorised.
- If it has, the connection succeeds.
- If not, the connection fails.
If you then want to log in, you go through the connection result resolution.
The subtle thing is that you may go to step 2 even if the user has never used the app on the device before! So, for example, if I go to your website and sign in there, then install your android app.
- The app starts, and retrieves a list of your user accounts (via the GET_ACCOUNTS permission)
- It tries to connect to Google Play services with any of the accounts
- Google Play services calls out to the Google auth servers, finds out you have already signed in to that application (in this case, on the web)
- The app gets the onConnected callback
So the reason that there is no login method is that the login status is actually remote - it lives on the Google servers, not on the device itself. The flow therefore has to be asynchronous.
Solution 2:
I am aware that this thread is very old. Updating as this comes up every time on Google. Now that google play store API v 8.4 is released, onConnectionFailed does exactly what it has to do.
Solution 3:
Here is pretty normal example https://developers.google.com/+/mobile/android/sign-in:
There is method
`@Override
public void onConnected(Bundle connectionHint) {
mSignInClicked = false;
Toast.makeText(this, "User is connected!", Toast.LENGTH_LONG).show();
}`
first steps are there https://developers.google.com/+/mobile/android/getting-started
Post a Comment for "Why Does Google+ Login Accomplish Login With An Error?"