-1

I made authorization with instagram in safari then opens my redirect-URL: “https://badyi.github.io + code “. I need to grab redirect-URL. What is url-scheme here? What is identifier? What i have to put in info: URL-types?

I know about canOpenUrl method, but idk what to put in info

For example: bundleID: 999 clientID: G0G Secret: 666W redirect_URL : https://badyi.github.io

Upd: I use oauth2 to use instagram profile data in my ios app. what I got: 1) the application opens 2) by clicking on the button, opening the safari with the authorization page 3) after logging in, redirect_url opens in safari

I expect that after 3 steps I will be transferred to my application and I will be able to handle my redirect url

badyi badyi
  • 11
  • 1
  • 5

2 Answers2

1

Your redirect url has scheme https. It means open "in web", that's why it was handled by Safari

If you want to return to your app after auth, you need to implement your own scheme

Please check documentation about this feature

Viktor
  • 1,020
  • 1
  • 9
  • 22
0

Option 1: Deeplinks

As @viktor mentioned, you need to implement your own scheme in your application, and set redirect_URL to it.

For example, if you have application named "FooBar", you can make scheme foobar, so the redirect_url can be something like: foobar://returnFromRedirect?maybeArg=some, then, you need to parse this URL in your application and proceed it properly. Here an article about it

Option 2: Universal Links

You can add trusted domain to your application, so all links from this domain can be opened with your application. Apple documentation

Alexey Lysenko
  • 1,890
  • 2
  • 12
  • 28