- Home /
Unity iOS Android: open local HTML in Browser
Hello community,
I want to be able to generate an HTML file and open it with browser.
At first I save all the necessary files locally and then in Unity editor I open them with
Application.OpenURL("file://" + localhtmlAddress.Replace(" ", "%20"));
In Editor the address is
file:///Users/Bohdan/Library/Application%20Support/Tombooks/Tomplay/Print/index.html
and it works as expected.
On iOS the address is
file:///var/mobile/Containers/Data/Application/672D5D28-46ED-42BA-BD8D-E4D05ABEEBB7/Documents/Print/index.html
and it doesn't open anything.
On Android it doesn't do anything too.
My system to save and load local files works OK, I use it for other purposes and it's well tested.
So I'm sure that all the files are in the correct places, the only problem is how to run them with Browser.
Answer by FlaSh-G · Jun 26, 2017 at 07:30 PM
The function's documentation states
In the editor or standalone player this will open a new page in the default browser with the url.
That sounds like it's not even supported in mobile builds.
Using this function I can open browser with Web address or marketplace. So I expect it to open local HT$$anonymous$$L files in Browser too.
Your answer
Follow this Question
Related Questions
Send HTML email to native email client 3 Answers
How can I embed a browser within Unity? 0 Answers
Render HTML Content in Unity UI Mobile Platforms 0 Answers
Web based AR app 9 Answers
[FIXED]Application.URL woes 1 Answer