我創建了一個類NSObject的和我在它這個身份驗證功能:遊戲時未通過身份驗證玩家中心登錄表單精靈套件
-(void)authenticateLocalUser {
if(!gameCenterAvailable) { return; }
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
__weak GKLocalPlayer *blockLocalPlayer = localPlayer;
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
NSLog(@"authenticateHandler");
if (viewController != nil)
{
NSLog(@"viewController != nil");
}
else if (blockLocalPlayer.isAuthenticated)
{
NSLog(@"localPlayer already authenticated");
//do some stuff
}
else
{
NSLog(@"local player not authenticated");
// not logged in
}
};
}
它的新版本我擡起頭來,但其不顯示Game Center登錄表單。
如果你需要這個信息,我在我的AppDelegate.m中調用這個方法。
我想我必須把東西放在那裏,當玩家沒有登錄像獲取登錄表單。但我不知道如何。
感謝您的幫助!
正在打印哪些你的NSLog語句? – Thunk
好吧,如果im登錄到遊戲中心 - >玩家被認證,如果不是另一個。他們都正確顯示,我只是想如果玩家沒有通過驗證從遊戲中心 – Robin