gpt4 book ai didi

ios - Google Identity Toolkit 未获取用于登录的客户端 ID

转载 作者:可可西里 更新时间:2023-11-01 03:19:18 25 4
gpt4 key购买 nike

我在我的 iOS 9 兼容应用程序中使用 Google Identity Toolkit 进行联合登录。我最近更新了所有的框架和库,并开始使用 Cocoapods 进行依赖管理。现在,虽然 Facebook 登录工作正常,但当用户点击“使用 google 登录”按钮时,会抛出以下错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GIDSignIn|'

我的AppDelegate中设置clientID的配置代码如下:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
GITClient *gitkitClient = [GITClient sharedInstance];
gitkitClient.apiKey = GITKIT_API_KEY;
gitkitClient.widgetURL = GITKIT_WIDGET_URL;
gitkitClient.providers = GITKIT_PROVIDERS;
[GPPSignIn sharedInstance].clientID = GOOGLE_CLIENT_ID;

...various unrelated code...
}

如有任何指导,我们将不胜感激。

最佳答案

https://developers.google.com/identity/toolkit/ios/quickstart#step_3_set_up_the_quick-start_app 所述, [GIDSignIn sharedInstance].clientID 需要初始化:

  GITClient *gitkitClient = [GITClient sharedInstance];
gitkitClient.apiKey = GITKIT_API_KEY;
gitkitClient.widgetURL = GITKIT_WIDGET_URL;
gitkitClient.providers = @[ kGITProviderGoogle ];
[GIDSignIn sharedInstance].clientID = GOOGLE_CLIENT_ID;

关于ios - Google Identity Toolkit 未获取用于登录的客户端 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33324607/

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