Instagram redirect URI doesn't match or some time safari says "Cannot open because invalid address" + iOS native app

4.9k Views Asked by At

I'm using this iOS Library https://github.com/crino/instagram-ios-sdk to login to instagram from my native app for sharing and getting feed from Instagram APIs. When i brought classes from this demo app to my project, here it is what happens:

Application successfully opens Authorization URL in safari and when i enter my credentials & authorize, it says "Safari cannot open address because its invalid" before redirecting to app or some time says "Redirect URI does not match registered URI".

Any help on this is appreciated.

2

There are 2 best solutions below

2
On BEST ANSWER

You have to add URL scheme to your application's plist file, it's mentioned in short guide on github instragram page: Make sure you've edited your application's .plist file properly, so that your applicaition binds to the ig[clientId]:// URL scheme (where [clientId] is your Instagram application CLIENT ID).

Here you'll find more information, see this article on TutsPlus: iOS SDK Working With URL Schemes

0
On

That error indicates that the URI you gave it is not handled by anything in the phone.

For example - the skype uri looks like skype: IF skype is installed, it opens skype. If skype is NOT installed, you get that same error.

You are either using the wrong URI (probably because you got the client-id wrong - do not include the [] in it), or, you do not have the Instagram app installed on your iOS device, or possibly you've messed with your instagram account and the app is not listening to that URI anymore.