我正在制作一个将gmail集成到我的应用程序的应用程序。我可以通过gadata-objective c-client-1.11.0.a登录到gmail。我正在提供代码
-(IBAction)googlelogin
{
NSString *scope = @"https://www.googleapis.com/auth/plus.me"; // scope for Google+ API
GTMOAuth2ViewControllerTouch *viewController = [[[GTMOAuth2ViewControllerTouch alloc] initWithScope:scope clientID:kMyClientID clientSecret:kMyClientSecret keychainItemName:nil delegate:self finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease];
NSString *html = @"<html><body><div align=center>Loading sign-in page...</div></body></html>";
[viewController setInitialHTMLString:html];
[self presentModalViewController:viewController animated:NO];
}
现在,我想在Google登录后重定向回我的应用程序以获取gmail的联系人。帮助我如何生成已拍摄并在登录后返回我的应用程序
谢谢
最佳答案
您应该实现该方法
- (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController
finishedWithAuth:(GTMOAuth2Authentication *)auth
error:(NSError *)error {
if (error != nil) {
// Authentication failed
} else {
// Authentication succeeded
// here you should push your the root view controller of your app.
}
}
关于iphone - 在gdata集成中从uiweb View 重定向返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13507026/