Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

How can I create a URI for my iOS app, so that I can register it was the Instagram API under the field "redirect URI"?

This is something I've been working on for weeks now and I've decided to use my Treehouse to see if I can get some answers.

Here's what I'm trying to do: I have an iOS app, and I want the user to be able to login (authenticate) with their Instagram account using the Instagram API. There is a step in registering with Instagram that they ask for a "valid redirect URI."

Here's what I know: Some people have suggested doing a custom URL scheme, entering a value like: myapp:// ... but this doesn't work because Instagram API only accepts https:// values. So any of the "it doesn't matter, just put something in there" answers do not work. So then I think to myself, I have a website domain for my app, myapp.com, say, I can enter that as the "redirect URI," but I'm not sure if that is a valid approach.

If anyone can please help me understand this, it would be much appreciated. (Also, this particular problem seems to be bugging many people, because it's not adequately answered on StackOverflow).

Thank you.

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

Sorry Tony. I would like to be able to that yes, this does work, but I don't know. I hope you find the answer!

1 Answer

Michael Hulet
Michael Hulet
47,913 Points

I'm almost certain what you're looking for here is the custom URL scheme thing. This is so Instagram can open your app again once it's done with the OAuth flow. That being said, it'd probably be a lot easier if you used an Instagram framework that handled this for you, like InstagramKit