I am trying to implement cross-login using Google Plus in my Android app.
How to implement this is not very well documented, and the best documentation I found is the video , and these sample applications on github.
Considering the code is a sample Android application , and what Google developers say in the video , I understand that the following will happen:
I install and run the application on device A. This device has only one Google account, which has never been logged into the application.
onCreate () will call PlusClient # connect (). Since the user has never logged in to another device, we get onConnectionFailed ().
If the user presses the login button, we will execute the file mLastConnectionResult.startResolutionForResult (), which will execute PendingIntent, which will ask the user for permission.
Now that the user has granted permissions, a new call to PlusClient # connect () will result in onConnected ().
Now we install the application on device B. This device has only one Google account, the same as device B.
In onCreate () we will run PlusClient # connect ()
Since the same Google account previously granted the same set of permissions / scope on another device, onConnected () is called.
7 . .
, mlastConnectionResult.startResolutionForResult(), , , onCreate, onConnectionFailed(), .
, , ( , ), .
.
.
:
- Google Play
- ,
- Google.
- , github