I could use some help understanding some HTM5 export issues.
The app I've been working on for the last year, a 3D simulation of tying fishing flies, will be published on the mobile app stores soon, but I'm using an HTML5 version to let people try it out before release. I've had some odd issues with HTML5 exports that I've tried to pin down for some time. Sometimes an export opens fine, and sometimes the colored wheel spins forever. From what I can tell this seems to be a pattern:
If I include the domain name in the export, including the "www.", the app will run in Chrome on Windows or iOS, but won't open running Chrome on Android. If I leave off the "www." it's the opposite, opening on Android but not on Windows or iOS. I currently have links to an app exported both ways on www.flytyingsimulator.com. The first link (labeled for Windows and iOS) was exported with the www.flytyingsimulator.com domain, and the second link (labeled for Android/iOS) was exported with a domain of just flytyingsimulator.com. In all cases I'm exporting with "encrypt code" and "encrypt assets" checked, but nothing else.
Am I missing something, or is this a bug?
If I'm right about the pattern I suppose I can make a landing page that redirects to one export version or the other based on the detectOS() JavaScript function.
Another thing I'm seeing from HTML5 exports is URLLoaders don't seem to be working. On some platforms I find I can load a file only with an "HTTPS://" prefix, and on others only with "HTTP://", so I have the code attempt to load a tiny text file (I use www.pishtech.com/nettest.txt) twice, one with each protocol, and whichever one works, that's the protocol I'll include in the URLs for all URLLoaders during that session. On HTML5 the load fails both ways, triggering and Event.ERROR. If I leave off the protocol completely and just try to load www.pishtech.com/nettest.txt, I get an Event.COMPLETE, but the resulting data is a 404 Not Found error, not the contents of the file.
Is anyone using URLLoaders in an HTML5 export? If so is there anything special to know?
In this case the reason I'm using URLLoaders is to minimize the size and thus the load time for the app. It has a few MB of optional textures it may display for in-app user instruction, and I have it download them in the background. That way the app has almost no graphical assets, so it downloads and starts quickly, and the images are very likely downloaded and ready to show when they're needed. If not the app just shows the instructional text without the image.
Paul
Comments
Likes: MoKaLux
Could this be due to redirects or DNS canonical name for your site ?
For the UrlLoaders on HTML5, I've learned more about what's going on:
If I use a loader to access a web API, that API will run (I see database entries reflecting the API call) but it looks like Gideros will only get an Event.COMPLETE with the output of that API if the API is on the domain for which the project was exported. Otherwise it gets an Event.ERROR and no data from the API.
In my case, to test network access I have the app on flytyingsimulator.com try to access a text file on pishtech.com, and I get the error event. Moving the same text file to flytyingsimulator.com and accessing it there works.
Likes: MoKaLux
You should configure pishtech.com so that it includes a response header like
Access-Control-Allow-Origin: *
https://flytyingsimulator.com/nettest.txt
https://pishtech.com/nettest.txt
But it can't access either with the www, getting an Event.ERROR:
https://www.flytyingsimulator.com/nettest.txt
https://www.pishtech.com/nettest.txt
Both are add-on domains on the same virtual private server. So this doesn't seem to be an issue with the domain an HTML5 export is targeted to, or whether it's accessing something on a domain different from the one where it's running. Rather it seems as though in cases where the variable location.href includes the www, it will only succeed in accessing those two domains if they include the www, and vice versa.
Yet in the same browser I can open the test file (nettest.txt) either with or without the www.
I remain confused.
It even works with both https and https, both with and without "www." in the URL. I expected access between the two domains to work within an HTML5 export too, but I'm unfamiliar with CORS. I'll educate myself a least a little on that.
Thanks!
Paul
Likes: MoKaLux