2

From my iphone app I an calling a url in safari.How can i revert back to my iphone app from that webpage

just like we return back to our apps after facebook authentication ?

NITHIN SHAHRUKH
  • 155
  • 1
  • 3
  • 10
  • 1
    [What have you tried?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – rohan-patel Mar 11 '13 at 14:56
  • I tryed to call a url on safari from my app.I found some tutorials call back methods but really not getting the idea Any way if u give any kind-even one line of answer and upvote me,i would have agreed But anyone can do this thing without having any knowledge.. – NITHIN SHAHRUKH Mar 11 '13 at 14:59

1 Answers1

5

You can use a URL scheme if you have control of the web page. Simply add a link using your scheme.

If your scheme is myapp: then:

<a href="myapp://return_info">Return to the app</a>

See this site for a tutorial.

Richard Brown
  • 11,346
  • 4
  • 32
  • 43
  • I have controll of the webpage.But how can I come back to app on a button click from web page ?? – NITHIN SHAHRUKH Mar 11 '13 at 17:15
  • Did you read the link? **URL schemes** will allow you to relaunch the app as well as pass information (in the form of the URL) back to the app. – Richard Brown Mar 11 '13 at 18:16
  • yep I did..But that link tells about switching two apps,right ? – NITHIN SHAHRUKH Mar 11 '13 at 18:42
  • 2
    Ok, here's a link that spells it out more clearly: http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html – Richard Brown Mar 11 '13 at 18:44
  • thanks Richard..I allready have gone through that but.. what should I write in this - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { // Do something with the url here } – NITHIN SHAHRUKH Mar 11 '13 at 18:48
  • Take the user back to where they were when they left the app. If the website was doing something it needs to tell the app pass it back in as values in the querystring. Your app has access to the url that called it in the `url` parameter. – Richard Brown Mar 11 '13 at 18:52
  • thank you richard for your patience.. – NITHIN SHAHRUKH Mar 11 '13 at 18:55