Read More
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

    Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!

    Deniel Kerr

    Owner and Founder. Opencart

    Talk to Sales
    Start a Project

      Message Sent!

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

      Back to Home