Iphone 在gdata集成中重定向回uiweb视图

Iphone 在gdata集成中重定向回uiweb视图,iphone,objective-c,ios,uiview,gdata,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 =

我正在制作一个应用程序,将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];        

}
-(IBAction)谷歌登录
{
NSString*作用域=@“https://www.googleapis.com/auth/plus.me“;//Google+API的作用域
GTMOAuth2ViewControllerTouch*viewController=[[GTMOAuth2ViewControllerTouch alloc]initWithScope:scope clientID:kMyClientID clientSecret:kMyClientSecret keychainItemName:nil委托:自完成选择器:@selector(viewController:finishedWithAuth:error:)]autorelease];
NSString*html=@“正在加载登录页…”;
[viewController setInitialHTMLString:html];
[自呈现ModalviewController:viewController动画:否];
}
现在我想在谷歌登录后重定向回我的应用程序,以获取gmail的联系人。帮助我如何生成Take并在登录后返回到我的应用程序


谢谢

您应该实施该方法

- (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.
 }
}

你能帮我解决这个错误吗----身份验证错误:error Domain=com.google.HTTPStatus Code=401“操作无法完成。(com.google.HTTPStatus error 401)。”