iphone - 在gdata集成中从uiweb View 重定向返回

标签 iphone objective-c ios uiview gdata

我正在制作一个将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/

相关文章:

iphone - 需要从 nsarray for 循环更新 nsmanagedobject - iphone

objective-c - uitableviewcell 分隔符在 ios 8 中移动

ios - NSDate、NSDateFormatter 的奇怪行为

ios - 在函数内部使用关键字 guard 是否会自动使函数的参数在 swift 中成为可选参数?

ios - 无法将 NSData header 与 Swift 中的字符串进行比较

iphone - iOS 4 无法访问变量导致应用程序崩溃

iphone - 远程安装iPhone开发应用程序

iphone - iOS 中有趣的开关错误

objective-c - NSData/CFData 使用 @autorelease 桥接,但不使用 ARC

ios - Swift 3 部分中的行数无效