I’m trying out Unity’s native GameCenter support (i.e. Social.localUser.Authenticate), and it’s working fine on iOS, but when I try it on Mac, the callback that I pass to Authenticate just never gets called, and the GameCenter login prompt reappears every time the app gets focus.
Specifically, these are the scenarios I’m encountering:
On iOS, I press my debug “authenticate gamecenter” button, and a few seconds later, the callback that I passed to Social.localUser.Authenticate gets called, with its success argument set to TRUE, and I’m able to read the correct values from things like Social.localUser.id. All good.
On Mac, if I follow the UNSH “Unity Apple Distribution Workflow” to sign a development build with an entitlements file containing a “com.apple.developer.game-center” key, it launches fine, but as soon as I click the “authenticate gamecenter” button, a GameCenter login prompt appears (even though I’m already logged in in System Preferences > Internet Accounts), and when I enter my username and password, the prompt goes away successfully (which it wouldn’t if the password was wrong for example), but then the callback that I provided to Authenticate never gets called… and as soon as I click any other window, then click back into the game window, the login prompt appears again (even though I absolutely haven’t called Authenticate a second time; I have Debug.Log calls in place to make sure).
And just for context, if I sign the mac build WITHOUT the “com.apple.developer.game-center” key, the Authenticate callback actually DOES get called, with its success argument set to FALSE (presumably due to the missing entitlement). So it’s interesting that it isn’t even “Authenticate never calls back on Mac”; it’s that it never calls back SUCCESSFULLY, but it WILL call back if something goes wrong.
Has anyone else encountered this? Why is it firing off the login panel every time it gains focus? Are there any extra requirements besides the “com.apple.developer.game-center” entitlement in order to successfully access GameCenter in a Mac OS dev build?