谷歌玩游戏在iOS上登录错误

时间:2016-08-14 12:00:13

标签: ios google-play-games google-signin

您好我想在我的iOS应用上登录谷歌玩游戏。 我手动安装了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)"

即使在我点击允许权限后,它也会将我带回我的应用程序,但即使是功能也没有任何结果:

- (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 个答案:

答案 0 :(得分:1)

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

我认为这是由于新ios版本ios9的更改。

blog上找到了这个。

  

关于iOS 9中URL方案更改的关键点是隐私   以及您的应用会话,从大约9分钟开始   标题为“应用程序检测”。

     

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

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