hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.14k stars 394 forks source link

PWA - iOS error when loading #351

Closed ejhessing closed 1 year ago

ejhessing commented 1 year ago

Hello

I have been having trouble getting a PWA version (saved as an app) to work on an iOS iPhone. It works pretty much everywhere else (ios when using the browser, android on the browser and as an app on a phone, desktop iOS, etc).

I have recreated the basic example:

After you save the app to the home screen (through safari), the app asks for permission to access the camera, after I tap allow, it just stays on the loading screen forever.
When I try to debug it through safari web tools, there are no errors in the console, but in the elements view it shows the "Failed to launch :( ... please try the following recommended browsers:" elements.

From looking at the other past issues on GitHub people seem to see that message when they're not using HTTPs, but this is deployed to netlify and thus I believe it should be secure?

Been banging my head on this for awhile and am not sure where to go next, appreciate any help.

Cheers

hiukim commented 1 year ago

What do you mean "save the app to the home screen"

ejhessing commented 1 year ago

Sorry, should have updated this, I got it past this point, something was cached in safari that prevented this interaction for me.

There is one problem with A-Frame and working offline with Safari though. It makes a call to check whether the src passed into the a-image element is actually an image. Even if you have an image cached safari tries to make the call, which errors and stops the whole process. I had to prevent this call that A-Frame does to make the cached images work offline. Hopefully, this helps someone