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];
Aav
source share