Google play 游戏在 iOS 上登录错误

Posted

技术标签:

【中文标题】Google play 游戏在 iOS 上登录错误【英文标题】:Google play games sign in error on iOS 【发布时间】:2016-12-20 21:18:30 【问题描述】:

您好,我正在尝试在我的 ios 应用上登录 Google Play 游戏。 我已经手动安装了 sdk,并按照谷歌网站上的入门教程所说的做了一切。 但是,当我单击登录按钮时,应用程序会将我带到 safari,并且我会在控制台中收到这些消息:

2016-08-14 14:32:26.450 פקודה![34477:5811630] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.1://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.4.1"
2016-08-14 14:32:26.452 פקודה![34477:5811630] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.4.0"
2016-08-14 14:32:26.454 פקודה![34477:5811630] -canOpenURL: failed for URL: "com.google.gppconsent.2.3.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.3.0"
2016-08-14 14:32:26.455 פקודה![34477:5811630] -canOpenURL: failed for URL: "com.google.gppconsent.2.2.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.2.0"
2016-08-14 14:32:26.456 פקודה![34477:5811630] -canOpenURL: failed for URL: "com.google.gppconsent://" - error: "(null)"
2016-08-14 14:32:26.457 פקודה![34477:5811630] -canOpenURL: failed for URL: "hasgplus4://" - error: "(null)"
2016-08-14 14:32:26.486 פקודה![34477:5811630] -canOpenURL: failed for URL: "googlechrome-x-callback:" - error: "(null)"
2016-08-14 14:32:26.487 פקודה![34477:5811630] -canOpenURL: failed for URL: "googlechrome:" - error: "(null)"

即使在我单击允许权限后,它也会将我带回我的应用程序,但即使是 func 也没有任何反应:

- (void)didFinishGamesSignInWithError:(NSError *)error 
    if (!error)
    NSLog(@"GooglePlayGames finished signing in!");
    else
    NSLog(@"***Error signing in! %@", [error localizedDescription]);


根本没有被调用。请帮忙

这是我的登录代码:

- (void)viewDidLoad

    [super viewDidLoad];

    [GIDSignIn sharedInstance].clientID = kClientID;
    [GPGManager sharedInstance].statusDelegate = self;
    [GIDSignIn sharedInstance].uiDelegate = self;

    _currentlySigningIn = [[GPGManager sharedInstance] signInWithClientID :kClientID silently:YES];


# pragma mark -- GIDSignInUIDelegate methods

- (void)signIn:(GIDSignIn *)signIn
didSignInForUser:(GIDGoogleUser *)user
     withError:(NSError *)error

    NSLog(@"%@",user);



# pragma mark -- GPGStatusDelegate methods

- (void)didFinishGamesSignInWithError:(NSError *)error 
    if (!error)
    NSLog(@"GooglePlayGames finished signing in!");
    else
    NSLog(@"***Error signing in! %@", [error localizedDescription]);


- (void)didFinishGamesSignOutWithError:(NSError *)error 
    if (error)
        NSLog(@"Received an error while signing out %@", [error localizedDescription]);
     else
        NSLog(@"Signed out!");


- (IBAction)signInButtonWasPressed:(id)sender 
    [[GPGManager sharedInstance] signInWithClientID:kClientID silently:NO];


- (IBAction)signOutButtonWasPressed:(id)sender 
    [[GPGManager sharedInstance] signOut];

【问题讨论】:

【参考方案1】:

这是我发现的“此应用不允许查询方案”

我认为这是由于新的 ios 版本 ios9 发生了变化。

在 blog 上找到这个。

关于 iOS 9 中 URL 方案更改的关键部分是隐私 和 Your Apps 会话,从大约 9 分钟开始 标题为“应用检测”。

iOS 上的应用程序可以使用两种与 URL 相关的方法,它们分别是 影响:canOpenURL 和 openURL。这些不是新方法,而且 方法本身并没有改变。正如您所期望的那样 名称,“canOpenURL”在检查是否存在后返回是或否答案 是设备上安装的任何知道如何处理给定的应用程序 网址。 “openURL”用于实际启动 URL,这将 通常会离开应用并在另一个应用中打开 URL。

查看SO thread 中的代码实现以获取更多信息。

【讨论】:

以上是关于Google play 游戏在 iOS 上登录错误的主要内容,如果未能解决你的问题,请参考以下文章

Google Play 游戏服务登录错误:ApiException:4

Google Play 游戏服务登录按钮吐出“未知错误”

使用 Google Apps 帐户登录时,在 Android 上对 Google Play 游戏服务进行身份验证会导致错误

Google play 服务游戏静默登录错误 'com.google.android.gms.common.api.ApiException: 4:'

Unity Google Play 游戏插件:错误未授权

无法登录 google play 游戏服务 API