In the game I’m working on we want to display the players current rank on the gamecenter leaderboards at the end of every game. The functions I’d written to do this were never getting called though, and here’s why - before I tried to query the leaderboards I’d check the following:
Social.localUser != null Social.localUser.state != UserState.Offline
It turns out this never worked, because the state of the local user is always offline. This is despite the fact that in other places in the game we can check the leaderboards, get a friends list, etc., i.e. all the things you’d need to be logged into gamecenter and online to do.
If I change the check to this:
Social.localUser != null Application.internetReachability != NetworkReachability.NotReachable
then everything seems to be working as intended.
Am I doing something wrong here? Should it be possible for the localUser state to be offline while everything else about gamecenter works fine?