OGeek|极客世界-中国程序员成长平台

标题: c# - unity Game Center 登录对话框取消后不再显示 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 22:16
标题: c# - unity Game Center 登录对话框取消后不再显示

我在将用户登录到 Game Center 时遇到问题。在应用程序完成加载后,我首先显示登录对话框。如果用户取消对话框。该按钮不执行任何操作 - Game Center 对话框未显示。我立即收到错误消息

错误代码:-

_authenticateUsingAlert: Failed to authenticate player with existing credentials.Error: Error Domain=GKErrorDomain Code=6 "The requested operation could not be completed because the local player has not been authenticated." UserInfo={NSLocalizedDescription=The requested operation could not be completed because the local player has not been authenticated

Social.localUser.Authenticate(success => {
            if (success)
                Debug.Log("success authenticate");
            else
                Debug.Log("Failed to authenticate");
        });



Best Answer-推荐答案


这里是您问题的答案:https://stackoverflow.com/a/21132075

Important: Game Kit handles opting out of Game Center across all games that support Game Center. If a player has already declined to create an account, when your game authenticates the player, it is told there is no authenticated player. The player never sees an authentication dialog. Because Game Kit handles this process across all games, your game should not include its own mechanism to disable Game Center authentication or ask a player’s permission to authenticate. Instead, your game should simply authenticate the player every time it launches and respond appropriately when authentication completes.

关于c# - unity Game Center 登录对话框取消后不再显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54820937/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4