This question is asked in the context of the Google Play Services plugin for Unity.
Following the documentation for the Google Play Services plugin for Unity, I called the Social.localuser.Authenticate()
function in my game to check if the player is authenticated (ie: logged in to google play services).
Here is the authentication code that I am currently calling:
void Awake ()
{
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool success) => {
if (success)
{
GetLeaderboardData("FirstLoad");
}
else
{
loadingText.text = "Failed to connect to Google Play Services.";
StartCoroutine("WaitAndStart");
}
authenticated = success; //success returns true even without an active internet connection
});
}
This works fine with an active internet connection. However, if the player has logged in before, and then launch the game without an internet connection, this function somehow returns true
. It doesn't make sense (at least not to me) that the player can authenticate without an active internet connection. Does anyone know if this was intended? (Or if I made a mistake of some sort somewhere?)
Should it have been indeed intended (and the method is checking against a cache of some sort), is there no method to check if the player has an active connection to google's servers? Something along the lines of PlayGamesPlatform.CheckConnection()
?