gpt4 book ai didi

ios - Google 通过我的 iOS 应用登录

转载 作者:行者123 更新时间:2023-11-28 21:19:03 30 4
gpt4 key购买 nike

我想将 Google 登录集成添加到我的应用程序中。但是我想使用 Google SDK 而不是使用 cocoa pods,如果有人使用过此 iOS SDK,请告诉我登录和获取用户详细信息的步骤,因为我没有为此获得适当的文件。

我使用的是 Google Sign-In SDK 4.0.1,因为委托(delegate)方法没有被调用。

我正在使用以下结构:

- (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 {

}

但是这个委托(delegate)方法中的任何一个都没有被调用。

任何帮助将不胜感激。谢谢

最佳答案

在xcode 8.0和ios 10中你需要在capabilities中开启keychain sharing。

enter image description here

关于ios - Google 通过我的 iOS 应用登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40587815/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com