您好,我正在尝试在我的 iOS 应用程序上集成 google+ 登录。我已按照此说明进行操作link https://developers.google.com/+/mobile/ios/getting-started.
这些示例工作正常,但是当我尝试在我的应用程序上实现时,它得到了这个
errorTerminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSBundle gpp_registerFonts]: unrecognized selector sent to class 0x16af620'
我添加了以下框架Image http://screencast.com/t/GlFRYlDNOPZU任何帮助
代码:在我的视图的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;
之后我添加这个功能
- (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);
}
我在 GPP SignInButton 类的视图中添加了一个按钮。