I followed http://googlemac.blogspot.com/2011/05/ios-and-mac-sign-in-controllers.html to allow users to use Google to login to an iPhone app. After I tap \"Allow access\" bu
I tried this trick and it gets work...
replace the webview shouldStartLoadWithRequest with this below method in GTMOAuth2ViewControllerTouch.h. It will not show the authentication code page.
*- (BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
if (!hasDoneFinalRedirect_)
{
hasDoneFinalRedirect_ = [signIn_ requestRedirectedToRequest:request];
if ([request.URL.absoluteString rangeOfString:@"https://accounts.google.com/o/oauth2/approval?"].location != NSNotFound)
{
self.redirectView.frame=[UIScreen mainScreen].bounds;
//webView.frame=[UIScreen mainScreen].bounds;
[self.activityView startAnimating];
[webView addSubview:self.redirectView];
return YES;
}
else if(hasDoneFinalRedirect_) {
// signIn has told the view to close
return NO;
}
}
return YES;
}*
in this I am adding my own custom view (redirectView) to this authentication page by checking this approval url https://accounts.google.com/o/oauth2/approval?
and You should also add activityView in xib of GTMOAuth2ViewControllerTouch to show the loader while redirecting back to the application.