How to use SafariViewcontroller as Callback on some URL in Objective C


Callback on some URL

Sometimes we need to use the browser for open authentication process like payment or sign in or other things for this we provide the response URL on success or failure through which identify when we have to close the safari.

Here I have taken a basic example where we are are creating the “test.html” file  and we are returning the custom URL look like:

Here  “freedomofkeima” is a URL Schemes.

After that you can set the response data to depend upon your need:

2: Now test.html file put into your MAMP’s htdocs folder.

3 :Now your local URL is:


4: Now start the Objective C code:

5: Here first create NSNOtification when it will throw the response:

6: Now launch the Safari:



Now Define the callback method:



7: Now go to Appdelegate.m file and write this one:

8: Now when you run this app this track your custom URL.











. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • rey
    thank you for your share, this article is very useful for me. thanks again.
    • anchit (Moderator)
      Your Welcome
  • css.php

    All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.

    Josh Arnold

    Josh Arnold

    Owner, Shop ATV Escape

    Talk to Sales


    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home