There's a function to check if you're logged in:
public static bool IsClientLoggedIn()
Wondering if I'm missing an event I can listen to for when the player's login becomes invalid for any reason?
There's a function to check if you're logged in:
public static bool IsClientLoggedIn()
Wondering if I'm missing an event I can listen to for when the player's login becomes invalid for any reason?
The thing to do is to check the responses to any Client API call to the service, to see if the response is that the token is not longer valid. In that case, you would need to sign the user back in. Please note that IsClientLoggedIn only checks if there is a session ticket - it does not perform an active query to the service. We do have a work item open to null the local session ticket when the response to an API call is that the token has expired, but even with that change it will still be important to properly manage any error responses.
I'm not sure if one can check the response if the SDK throws an exception when IsClientLoggedIn returns false on any PlayFabClientAPI call. Are you suggesting the client should wrap every API call in a IsClientLoggedIn check?
No, to be clear, I'm saying you need to check the response to all Client API calls for errors. If the error response is that the token is invalid, you should sign the user back in. The IsClientLoggedIn call just tells you if you (locally) have a session ticket, whether or not it is still valid.
2 People are following this question.