jamielob / reloader

More control over hot code push reloading for your production apps. Designed to replace mdg:reload-on-resume and provide a more production-ready approach.
28 stars 22 forks source link

fix splash screen bug and update splash screen package #11

Closed nerdmed closed 7 years ago

nerdmed commented 7 years ago

Dear @jamielob

we have encountered an bug using this package. As soon as the app runs into idle status but there is no new update the user is stuck inside the splashscreen as the package runs navigator.splashscreen.show() on resume. However there is no reason for the splashscreen to disappear if there is no update. _checkForUpdate will just run _waitForUpdate and this will lead to launchScreen.release(). I have added navigator.splashscreen.hide() to fix the problem. Normally the splashscreen should be removed on deviceready but i dont think the event is triggered on an resume.

Would be great to get some feedback. I have also updated the splashscreen to 4.0.0 - if the releasenotes are correct there are only some bugfixes.

PS.: To test it we have changed the settings to idleCutoff: 1000

jamielob commented 7 years ago

@nerdmed - Thanks, this looks reasonable to me. @lorensr has worked on this package more recently than me so want to get his thumbs up on here too.

nerdmed commented 7 years ago

@lorensr any news?

lorensr commented 7 years ago

What's the difference between navigator.splashscreen and launchScreen? When should we be using one versus the other?

nerdmed commented 7 years ago

@lorensr Honestly this is very confusing but as far as i think: the launchScreen is displayed when the app is started for the first time on an device. The splashscreen is manually displayed after the app has loaded to wait for the UI to be ready or something else. In most cordova apps splash and launchscreen look the same. Technically you can't programatically show a launchScreen because its tightly coupled with the app start and the launch process. You can only show a splash screen after the app has launched.

lorensr commented 7 years ago

Got it, thanks. Looks good