2016-08-14 54 views
1

您好,我正在尝试让Google Play游戏在我的iOS应用中登录。 我已经手动安装了sdk,并且做了一切,就像谷歌网站上的入门教程所说的那样。 但是,当我点击按钮的应用程序需要我Safari浏览器的符号和我得到这些消息在控制台:iOS上的Google play游戏登录错误

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

下面是我发现了大约“这个程序是不允许查询方案”

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

在此blog上发现此问题。

关于修订iOS中9 URL方案的关键位是隐私 和您的应用程序会话,开始在各地下 标题为“应用程序检测”的9分钟大关。

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

查看此SO thread中的代码实现了解更多信息。

相关问题