New bug in iOS 5: WebKit discarded an uncaught exception

I am trying to load a UIWebView using the Facebook OAuth authorization URL and I am using the following code. When my UIWebView loads with the Facebook login page, I enter my credentials and then click the "Login" button. When I click the button, I get the following error:

WebKit has thrown the uncaught exception in webView: solvePolicyForNavigationAction: request: frame: decisionListener: delegate: the application tried to present a modally active controller.

The same code works fine with iOS 4.3 and previous versions, but it does not work in iOS 5.0. I do not understand the problem, can someone help me?

 NSString *redirectUrlString = @"http://www.facebook.com/connect/login_success.html"; NSString *authFormatString = @"https://graph.facebook.com/oauth/authorize?client_id=%@&redirect_uri=%@&scope=%@&type=user_agent&display=touch"; NSString *urlString = [NSString stringWithFormat:authFormatString, _apiKey, redirectUrlString, _requestedPermissions]; NSURL *url = [NSURL URLWithString:urlString]; NSLog(@"NSURL: %@", urlString); NSURLRequest *request = [NSURLRequest requestWithURL:url]; [_webView loadRequest:request]; 
+7
source share
2 answers

Are you using Ray Wenderlich code? (FBFunLoginDialog). I found this fix:

 -(void)checkLoginRequired:(NSString *)urlString { NSLog(@"Url: %@",urlString); if ([urlString rangeOfString:@"login.php"].location != NSNotFound && [urlString rangeOfString:@"refid"].location == NSNotFound) { [_delegate displayRequired]; } else if ([urlString rangeOfString:@"user_denied"].location != NSNotFound) { [_delegate closeTapped]; } } 
+22
source

I have the same problem. I am trying to submit a view controller right after the rejection.

 [self dismissModalViewControllerAnimated:YES]; 

When I try to do this without animation, it works great. use rejectViewControllerAnimated: termination:

0
source

All Articles