objective-c – 面对谷歌加登录IOS的问题
发布时间:2020-12-14 19:55:38 所属栏目:百科 来源:网络整理
导读:我在整合google plus日志时遇到问题 我收到以下错误: 2015-02-17 20:03:39.377 SIR[288:14344] -[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a202015-02-17 20:03:39.383 SIR[288:14344] *** Terminating a
我在整合google plus日志时遇到问题
我收到以下错误: 2015-02-17 20:03:39.377 SIR[288:14344] -[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a20 2015-02-17 20:03:39.383 SIR[288:14344] *** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a20' 我以前用于谷歌登录的代码如下: -(void) setGooglePlusButtons { UIButton *googlePlusSignInButton = [UIButton buttonWithType:UIButtonTypeCustom] ; UIImage *backgroundButtonImage = [UIImage imageNamed:@"google.png"]; googlePlusSignInButton.frame = CGRectMake(0.0f,400,150,50); googlePlusSignInButton.titleLabel.textColor = [UIColor whiteColor]; googlePlusSignInButton.titleLabel.font = [UIFont boldSystemFontOfSize:11.0f]; googlePlusSignInButton.titleLabel.numberOfLines = 2; googlePlusSignInButton.titleLabel.shadowColor = [UIColor darkGrayColor]; googlePlusSignInButton.titleLabel.shadowOffset = CGSizeMake(0.0f,-1.0f); [googlePlusSignInButton setTitle:NSLocalizedString(@"",@"") forState:UIControlStateNormal]; [googlePlusSignInButton setBackgroundImage:backgroundButtonImage forState:UIControlStateNormal]; [self.view addSubview:googlePlusSignInButton]; [googlePlusSignInButton addTarget:self action:@selector(signInGoogle) forControlEvents:UIControlEventTouchUpInside];} - (void)signInGoogle { GPPSignIn *signIn = [GPPSignIn sharedInstance]; signIn.delegate = self; signIn.shouldFetchGoogleUserEmail = YES; signIn.clientID = KclientId; signIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil]; signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil]; [[GPPSignIn sharedInstance] authenticate];} - (void)signOut { [[GPPSignIn sharedInstance] signOut];} 并在应用程序委托 - (BOOL)application: (UIApplication *)application openURL: (NSURL *)url sourceApplication: (NSString *)sourceApplication annotation: (id)annotation { return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];} 我在顶部kclientId声明 static NSString * const KclientId=@"xxxxxxxxxxxxxxx.apps.googleusercontent.com"; 我已经尝试过了,但我无法找到问题,即我哪里出错了. 解决方法
我遇到了与Swift相同的问题,我认为你必须在构建设置上启用一些标志并启用一些库.
>转到构建设置/链接/其他链接器标志并添加不带引号的“-ObjC”.这假设您正在使用一些“头文件”来映射Google框架和Swift方法.>转到Build Phases> Link Binary with Librairies> >添加其他,转至de /usr/lib目录并选择“libz.dylib”>编译 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |