Game Center authentication error

后端 未结 2 411
面向向阳花
面向向阳花 2021-01-06 09:25

I\'m trying to call the authentication method of game center, however no authentication screen comes up and the callback return with an error : \"the requested operation has

2条回答
  •  悲&欢浪女
    2021-01-06 09:59

    You should do something like that after you have tested if game center is available on the specific device:

    GKLocalPlayer *localplayer = [GKLocalPlayer localPlayer];
    [localplayer authenticateWithCompletionHandler:^(NSError *error) {
        if (error) {
            //DISABLE GAME CENTER FEATURES / SINGLEPLAYER
        }
        else {
            //ENABLE GAME CENTER FEATURES / MULTIPLAYER
        }
    }];
    

提交回复
热议问题