我确实在 Google 站点中创建了一个控制台项目并获得了客户端 ID..
我确实在我的应用程序中实现了登录按钮并且它可以工作,但是登录后它不会回到我的应用程序,它会转到谷歌网站。
这是我的代码:
signIn = [GPPSignIn sharedInstance];
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:
kGTLAuthScopePlusLogin, // defined in GTLPlusConstants.h
nil];
signIn.delegate = self;
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
error: (NSError *) error
{
NSLog(@"Received error %@ and auth object %@",error, auth);
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
// attempt to extract a token from the url
return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}