[SOLVED] PlayCanvas not loading on iOS when coming back from sleep mode

Hello !

I’ve a problem when coming back from sleep mode in iOS when project is loading. The script playcanvas-stable.min display this error.

To reproduce it you have to press the sleep button while loading a play canvas project and then coming back. The heavier the project the more it will happen.

My guess is in this case success() called for 206 (partial file). If I understand it right, the function can be called even if the JSON downloaded is not complete.

Thanks let me know if you need more infos. :slight_smile:

Presumably this is just a matter of HTTP requests timing out? What do you suggest as a fix?

Thanks for your answer!

The perfect solution for us would be to call _onError() when this happen. And have a way to subscribe to the error so developers could do what they want to handle it.

Cool, but how would the code detect this event?

By subscribing to asset registry, which already has error event: http://developer.playcanvas.com/en/api/pc.AssetRegistry.html#event:error

1 Like

Thanks That’s what i’m looking for. But will this event be triggered even if _onError is not called?

Hello :slight_smile:
Sorry took me a while to answer but it did fix our bug.
Thanks