2016-11-14 102 views
0

我要在整合谷歌加號來我app.But我想使用谷歌SDK不使用可可豆莢,如果任何人都用這個的iOS SDK,請給我的步驟登錄並獲取用戶的詳細信息,因爲我沒有得到適當的文件。我使用谷歌登錄在該委託方法SDK 4.0.1谷歌通過我的iOS應用程序登錄

沒有得到調用。

我用以下結構:

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    [GIDSignIn sharedInstance].clientID = @"842331483294-ofk2cbhhfjoga35u1575t4hbq9ek87ii.apps.googleusercontent.com"; 
    [GIDSignIn sharedInstance].delegate = self; 
    [GIDSignIn sharedInstance].uiDelegate = self; 

    // Do any additional setup after loading the view, typically from a nib. 
} 

- (void)signIn:(GIDSignIn *)signIn 
didSignInForUser:(GIDGoogleUser *)user 
    withError:(NSError *)error { 
    // Perform any operations on signed in user here. 
    NSString *userId = user.userID;     // For client-side use only! 
    NSString *idToken = user.authentication.idToken; // Safe to send to the server 
    NSString *fullName = user.profile.name; 
    NSString *givenName = user.profile.givenName; 
    NSString *familyName = user.profile.familyName; 
    NSString *email = user.profile.email; 

} 
- (void)signIn:(GIDSignIn *)signIn 
didDisconnectWithUser:(GIDGoogleUser *)user 
    withError:(NSError *)error { 
    // Perform any operations when the user disconnects from app here. 
    // ... 
} 

- (void)signInWillDispatch:(GIDSignIn *)signIn error:(NSError *)error { 

} 

但任何這種委託方法是沒有得到調用。

任何幫助將不勝感激。 謝謝

+0

你配置谷歌開發者信息中心您的應用程序? –

+0

這個問題是否發生在ios 10? – KKRocks

+0

是, 在火力控制檯我的項目是Android管理,以便在iOS設備上也將是同一個項目,但只有iOS應用應該管理我已經配置我的應用程序,但使用火力控制檯,並且我已經做 – puja

回答

2

在Xcode 8.0和IOS 10,你需要啓用capabilites鑰匙扣共享。

enter image description here

+0

是的,我已經完成鑰匙串共享,但仍然無法工作。 – puja

+0

我得到 「類PLBuildVersion在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices(0x11de34998)中實現)和/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices(0x11dc59d38)。兩條之一將被使用。哪一個是未定義的。「 – puja

+0

你在appdelegate中處理了url方案嗎? – KKRocks

0

你可以用我的演示代碼,但是這不是4.0.1

Demo code link

+0

謝謝巴拉特, 我期待在此,如果有什麼我已經錯過了設置。 – puja

相關問題