- Home /
iPhone/iPad -> display URL -> iPhone/iPad
Hi, I'm wondering if Unity 3 allows an iPhone/iPad app to use Application.OpenURL("myURL"), show the page within a window (within Unity or as separate browser) and then somehow return to the Unity app? When I try this at the moment a browser window opens but it appears to close the Unity app and the only means of escaping the browser itself is to close it using the home button.
I have read a brief discussion concerning someone displaying a back button within an OnGUI call and this does appears to work when running the app with the Unity editor but on a device the Unity app doesn't display any 'back' button.
Thanks for any advice.
Answer by Bampf · Nov 02, 2010 at 06:21 PM
As far as I know this is a limitation of iOS. In older versions, your game closes and the browser opens. Your game is no longer running.
As of iOS 4, a form of multitasking was added. The user can easily return to apps that were interrupted by the launching of the browser or by a phone call. The last state of the app is restored as well so the user isn't starting over. iPad will be getting this feature soon with iOS 4.2.
The good news is that you don't have to do any work. Your Unity app will behave the same as any other app on the user's device, and they aren't going to blame you for the behavior.
There ARE apps that are able to render browser content themselves. These are typically RSS readers or social apps like twitter clients- not games. Unity doesn't come with this ability, and while in theory someone could make an add-on that would give this ability, I'd be surprised if anyone had bothered to do so.
See also: http://answers.unity3d.com/questions/2384/how-can-i-call-an-url The accepted answer mentions a way to display a static image of a webpage by using an external web service... It also mentions that a feature request exists on feedback.unity3d.com for adding HT$$anonymous$$L rendering to Unity. So although I argued in my answer above that it isn't a feature that games need, clearly not everyone agrees.
Looks like stinkbot can create an UIWebView to sit over and return to Unity ... might give it a go first myself though. Thanks for the feedback.
Your answer
Follow this Question
Related Questions
Sending e-mail from iPad/iPhone doesn't work 1 Answer
will unity run on the android browser 2 Answers
Unity games and web comunication 1 Answer
Unity IOS - Open a In-App Web Browser 2 Answers
open the web browser in unity iphone 1 Answer