0
votes

The app will show white page after splash screen before load. I tried remove mobile-experience package, add fastclick and mobile-status-bar packages, I added cordova-plugin-splashscreen plugin, and set preference follow:

App.setPreference('SplashScreen', 'CDVSplashScreen');
App.setPreference('AutoHideSplashScreen', false);
App.setPreference('SplashScreenDelay', '30000');

I hide the splash screen in startup event callback:

Meteor.startup(() => {
    if (Meteor.isCordova) {
        navigator.splashscreen.hide();
    }
});

But these both don't work, the white page still show ing after splash screen before app load. Anybody have any suggestions? Thanks in advance

1

1 Answers

0
votes

EDIT

Please note that Meteor.startup executes the given callbacks on the client (mobile app in your case) when the DOM is ready.

On a client, the function will run as soon as the DOM is ready.

But there may be a small duration between DOM ready and DOM loaded / fully rendered. This is probably where your white screen appears.

You can have a search on Internet and SO to see the difference between these 2 event families:


Original answer:

Well, instead of hiding the launch screen on Meteor startup, you might rather be interested in your case in holding it up a little bit longer to cover that white screen…

If you can re-add the launch-screen package, you could simply use:

// in a client-only javascript file
var handle = LaunchScreen.hold();

Template.myUI.onRendered(function () {
  handle.release();
});

Reference: https://atmospherejs.com/meteor/launch-screen

Note that by default, the launch-screen package holds your splash screen until the body is fully rendered.