I am working on a project for the iPhone where I need to take pictures with Instagram. I applied the following API as indicated on its developer's site:
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code
When I find this URL in my UIWebview , I get the following error:
Domain error = code WebKitErrorDomain = 102 "Interruption of frames"
But when I click the same URL in the device browser, it works. But it changes the url:
https://www.instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize/?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=token&scope=SCOPE
I also tried putting this changed URL in my code. Then he works and asks me to enter. But when I log in, I get this error.
{ "code": 400, "error_type": "OAuthException", "error_message": "You must include a valid client_id, response_type, and redirect_uri parameters" }
I recently created a client ID and checked all the parameters. So I'm not sure what the problem is. I googled and found that UIWebview does not allow this. So I put this in didFinishLaunching in my AppDelegate class:
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", @"UserAgent", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
But that doesn't work either. Please provide any decision on this.