Hi! I’m creating an iPad app that uses Application.OpenURL to open a dynamic webpage that shows a list of PDF files. The problem is that after using Application.OpenURL, a Safari window replaces my Unity app, and there is no button to go back or close the window.
Is it impossible to get back to the Unity app after using this method? If so, is there another way to show an html page without closing my app?
OBS: note that it doesn’t help to just “fetch” the contents of the page, because the pdf files are opened in new Safari windows anyway.
Some context (for the curious only): I’m creating a medical software here in Brazil and I’m using Unity to show a list of drugs (legal ones!). Each of those drugs has one or more “drug description leaflets” that can only be obtained from “Anvisa” website, a regulatory agency. I query the website with the drug’s name and get an html with a list of pdfs.
You’ll need to use a custom URL scheme. This will involve patching the application delegate and making some additions to the apps plist. This can all be done via script in Unit’s post process build step if you don’t want to do it by hand every time you build the Xcode project. You’d probably need to have your own web code with the site you were looking at in an iframe so you could have your own button to redirect to your URL scheme.
All that said, Prime31 offers the Etcetera plugin which implements a WebView that is part of your application rather than opening a separate browser and then needing URL schemes to open your app back up. This might be an easier choice. You could code this up yourself, but I’m guessing his price is cheaper than your time.