Handling Game Center authentication

前端 未结 4 1896
情书的邮戳
情书的邮戳 2021-02-06 13:41

According to the Apple docs we should do something like this to handle GC authentication:

- (void) authenticateLocalUser
{
    GKLocalPlayer *localPlayer = [GKLo         


        
4条回答
  •  生来不讨喜
    2021-02-06 14:17

    I might be wrong, but I think there actually is a way to know when the authentication view controller gets dismissed. I believe the initial authenticate handler that you set will be called when the user dismisses the authentication view controller, except this time the viewController parameter of the handler will be nil.

    The way my app works is: the authenticate handler is set at the beginning of the application, but the authentication view controller is only displayed when the user asks to view the Leaderboards. Then, when this authentication view controller is dismissed, the initial authenticate handler either displays the leaderboards if the user was authenticated or doesn't if he wasn't.

提交回复
热议问题