嗨,我想在我的iOS应用程序上集成谷歌+登录.我按照此链接的说明进行操作.
这些示例工作正常,但当我尝试在我的应用程序上实现时,它就是这样
errorTerminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSBundle gpp_registerFonts]: unrecognized selector sent to class 0x16af620'
我添加了以下框架 Image Any help
代码:在我的视图的viewdidload中
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
signIn.shouldFetchGoogleUserEmail = YES; // Uncomment to get the user's email
// You previously set kClientId in the "Initialize the Google+ client" step
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:
kGTLAuthScopePlusLogin, // defined in GTLPlusConstants.h
nil];
// Optional: declare signIn.actions, see "app activities"
signIn.delegate = self;
Run Code Online (Sandbox Code Playgroud)
之后我添加了这个功能
- (BOOL)application: (UIApplication *)application openURL: (NSURL *)url sourceApplication: (NSString *)sourceApplication annotation: (id)annotation
{
return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
error: (NSError *) error
{
NSLog(@"Received error %@ and auth object %@",error, auth);
}
Run Code Online (Sandbox Code Playgroud)
我在类GPPSignInButton的视图中添加了一个按钮.
| 归档时间: |
|
| 查看次数: |
4929 次 |
| 最近记录: |