2016-08-14 153 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中的代碼實現瞭解更多信息。

相關問題