ios – Google Identity Toolkit无法获取登录客户端ID

前端之家收集整理的这篇文章主要介绍了ios – Google Identity Toolkit无法获取登录客户端ID前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在iOS 9兼容的应用程序中使用Google Identity Toolkit进行联合登录.我最近更新了所有框架和库,并开始使用 Cocoapods进行依赖关系管理.现在,虽然Facebook登录工作正常,但当用户点击“使用谷歌登录”按钮时,会抛出以下错误
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: 'You must specify |clientID| for |GIDSignIn|'

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

- (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;
原文链接:https://www.f2er.com/iOS/333499.html

猜你在找的iOS相关文章