1
votes

I am using spalshscreen plugin for container app (loading inappbrowser url ) after complete launch of splash Screen . First time splashscreen launching as expected . But seconed ime onwards white screen displaying . If application removed from the device stack then it will display splash screen . I want to display splash screen once exit the app and relaunch it.

i added preferences in config.xml splascreendelay as well splashscreen icon

please help me for this issue

3

3 Answers

1
votes

had the same problem.

For Android this solution helped me:

i changed following in: \platforms\android\src\org\apache\cordova\splashscreen\SplashScreen.java

find this line: protected void pluginInitialize() must be line 71 and change

from:

        if (HAS_BUILT_IN_SPLASH_SCREEN || !firstShow) {

to

        if (HAS_BUILT_IN_SPLASH_SCREEN) {

Hope it helps.

0
votes

Like you stated yourself, the splashscreen is normally only visible on first startup of the app. The SplashScreen plugin however does contain functions to show the splashscreen again if you want to.

If you want to show the splash screen also when you app is moving to the background, and returning from the background, you should listen to the 'pause' event of cordova, which you can find here.

When this event is thrown, you should start the splashscreen again with navigator.splashscreen.show();. Then the splashscreen will be visible when closing the app, and will still be visible when you later on start the app again. To hide the splashscreen the next time you enter the app, you should call navigator.splashscreen.hide(); when it is appropiate.

More about the use of the splashscreen plugin you can find here.

0
votes

With latest version (4.1.0) of the plugin cordova-plugin-splashscreen you don't need to modify the source code of the plugin, but add in the config.xml file, the following preference:

<preference name="SplashShowOnlyFirstTime" value="false"/>