Open jessisar opened 6 years ago
Good catch! We have a fix in the works, expect it in the coming weeks. In the meantime you can use this workaround. Handling the resultCode of GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED will indicate that the user has signed out, so in this situation, you can use this to manually sign out.
Once the fix is in, you can remove this workaround. I'll update this ticket when the fix is live.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
signOut();
}
}
I'm running into the same issue. Even worse, if I can't catch the activity result, my client gets stuck in a state where it believes it is signed in, but is not. Ie. in this state:
02-17 16:18:49.011 E/AndroidRuntime( 1554): Process: com.limbic.revenant, PID: 1554
02-17 16:18:49.011 E/AndroidRuntime( 1554): java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called.
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.common.internal.zzd.zzaka(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.common.internal.zzd.zzakb(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.games.internal.GamesClientImpl.zzg(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.games.internal.GamesClientImpl.zza(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.common.api.internal.zzbr.signOut(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.common.api.internal.zzbp.zzaih(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at com.google.android.gms.common.api.internal.zzbp.handleMessage(Unknown Source)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at android.os.Handler.dispatchMessage(Handler.java:98)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at android.os.Looper.loop(Looper.java:154)
02-17 16:18:49.011 E/AndroidRuntime( 1554): at android.os.HandlerThread.run(HandlerThread.java:61)
The only way around this I've found so far is to:
All in all, this cost me quite a bit of time and I don't feel very confident that this solution is robust. While this is probably a corner case (as very few players will sign out from the leaderboard intent), it currently makes the otherwise smooth integration somewhat nasty & hacky, so a fix would be very welcome :-)
When you show the achievements or leaderboard activity and click on "settings" in the upper right corner and logoff, you will return to main_activity.xml where the UI still shows you are logged in.