Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Return to app from safari

In my application, I redirect the user to the safari browser when he/she taps on a button, which in turn closes the application and opens the safari browser. There is no problem in that. It works fine. The thing is when the user quits the safari browser, I want to redirect the user back to the application, not the home screen. Any idea please...

like image 214
ashok Avatar asked Apr 01 '11 11:04

ashok


People also ask

How do I go back to previous screen on iPhone?

Unlike Android, the iPhone doesn't have a dedicated "back" button. But, a little-known gesture makes that completely acceptable. In Messages, Mail and even Safari, simply swipe right from the edge of the screen to go to the previous window. The gesture even works in some third-party apps like Instagram.

How do I open my Safari apps?

You can have multiple apps open at the same time on your Mac, and leave them open. This is especially useful for apps you return to frequently, such as Safari or Mail. The quickest way to open an app on your Mac is to click the app's icon in the Dock.

How do I move an app from Safari to my home screen?

Swipe down on your Home screen to invoke the Spotlight search. Type in Safari and select the Safari browser from the search result. It shall take you to that app's location, aka folder or page. Drag and drop that Safari app to the Home Screen, and the task stands complete.


1 Answers

If you control the website that you are redirecting them to, then you can place a link on the site using custom URL which I describe in more details below. But if it's a site you don't control, you can have the user surf within your app using the UIWebView.

For an iOS app, you can create custom URL schemes that your app register with the system. Then on the web page you would create a link using that custom URL. That is how Apple launches the telephone.app or the mail.app from mobile safari.

For example: Let say your app is call BigBadApp. You custom URL would be: bigbadapp:// Now, you could create a link to your app would be: <a href="bigbadapp://launchedfromsafari">Launch BigBadApp</a> You can pass any kind of information back to your app using the custom URL and your app will handle that information in the app delegate. For iOS 4.2 and later: application:openURL:sourceApplication:annotation:. The name of old delegate on earlier version of iOS is application:handleOpenURL:

For more information see check Apple Implementing Custom URL Schemes. Also iOS developer:tips has a tutorial on Launching Your Own Application via a Custom URL Scheme.

like image 133
Black Frog Avatar answered Oct 11 '22 14:10

Black Frog