-->

trigger.io hangs on splash screen in iOS

2019-06-26 07:43发布

问题:

Oftentimes my app will hang on the "trigger.io FORGE" splash screen and never display my UI.

I have this happening both in the simulator and on a real device. It's intermittent which leads me to think maybe it's a race condition somewhere (do I need to be waiting for forge to initialize?).

I have no idea how to debug this as the trigger console isn't spitting out an error even when showing the debug output.

Anything I should check? It's weird because if I put in a call like this:

setInterval(function() {
    forge.logging.log('hi');
}, 1000);`

I can see that my JavaScript code is being executed (and continues to execute as this is successfully logged until I kill the app).. but it's still hung on the splash screen. Oftentimes hitting the home button and re-entering the app will work. But sometimes it takes a few rebuilds before it will get past the splash screen.

I've now seen this on 2 different dev environments, 2 different physical devices, and the iOS simulator.

回答1:

This sounds like a rare issue on iOS that causes the DOM event Forge listens for to hide the splash screen not to fire.

The easiest way to fix this is to make sure the splash screen is hidden by calling forge.launchimage.hide() at the point your code is ready. See http://docs.trigger.io/en/v1.4/modules/launchimage.html#hide for more details.

If that doesn't help then let us know and we can try to track down what else it could be.