Check Mobile App
Read now

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

Save

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:

“http://localhost:8888/test.html

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*


2 comments

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

    I sincerely thank everyone on the team for putting in your efforts so I can work 100% in my country without worrying that some local company will overcharge me and do the job wrong so I would definitely recommend anyone once again to work with the Webkul team. If I had to do this again I would definitely hire you without a second thought! thanks and wish you the best hope we keep working for a long time!

    Martin Blumenfeld

    Martin Blumenfeld

    Talk to Sales

    Global

    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