Is a
valid, even in case of an authentication error?
GKLocalPlayer.localPlayer.authenticateHandler =
^(UIViewController *viewController, NSError *error)
{
if (error)
{
bool a = GKLocalPlayer.localPlayer.authenticated;
}
else
{
This happens for instance when I have an authenticated player, moves the app to the background, disables the WiFi, and then move the app to foreground again. My hope is that GameCenter just continues with a cached account?
I find the manual a bit ambiguous. From https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Users/Users.html#//apple_ref/doc/uid/TP40008304-CH8-SW11:
"As soon as your game moves to the background, the value of the local player object’s authenticated property becomes and remains invalid until your game moves back to the foreground. You cannot read the value to determine if the player is still authenticated until Game Kit reauthenticates the player and calls your authentication handler. Your game must act as though there is not an authenticated player until your completion handler is called. Once your handler is called, value stored in the authenticated property is valid again."
Is the value valid even though the authentication failed?