I am developing a game for Android using Google Play Game Services using Xamarin. I am doing my testing using the Android Genymotion emulator. I ran into a problem that seems to be a bug in the implementation of Google Play or Xamarin.
If I log out of my Google account , calls to IGoogleApiClient.IsConnected () continue to return true (although I have obviously just left). If I try to use this API object, I will get exceptions, for example:
java.lang.SecurityException: not signed when calling API
For example, the following code throws the above exception if it is executed after the statement:
public void StartNewMatch() { if (!mGoogleApiClient.IsConnected) { return; } Intent intent = GamesClass.TurnBasedMultiplayer.GetSelectOpponentsIntent(mGoogleApiClient, 1, 1, true); StartActivityForResult(intent, RC_SELECT_PLAYERS); }
I exit the inbox of Google Play Games (Match Picker); as shown in the pictures below.
Has anyone come across this before? Am I missing something? Are there any problems?
Note. This only happens if you exit the Google user interface. If I manually log out of the user account with something like mGoogleApiClient.Disconnect() , the problem does not occur; mGoogleApiClient.IsConnected() now returns false (as expected).



android google-play-services google-play-games xamarin monogame
Goose
source share