Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto hiding Splashscreen with Phonegap Build

Using Phonegap (3.1.0), Phonegap Build and the Splashscreen plugin I am trying to prevent the splash screen from auto hiding. I will then hide the splash screen from within the JavaScript once the screen has fully loaded.

Currently the splash screen always autohides as soon as the app begins to load the JavaScript, my config.xml is as per below. Primarily I am having this issue on Android 2.2, although I have not looked at iOS yet which I also need to support.

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "com.savvy.mobile.Faversham"
        version   = "1.0.0">

    <gap:platform name="android" />
    <gap:platform name="ios" />

    <preference name="phonegap-version" value="3.1.0" />
    <preference name="splash-screen-duration" value="500000" />

    <!-- Default splash -->
    <gap:splash src="splash.png" />

    <gap:plugin name="org.apache.cordova.splashscreen" />  
</widget>
like image 267
Andy Polhill Avatar asked Nov 26 '13 14:11

Andy Polhill


2 Answers

It turned out that "splash-screen-duration" became "SplashScreenDelay" in phonegap 3.1.0.

Change this

<preference name="splash-screen-duration" value="500000" />

to

<preference name="SplashScreenDelay" value="500000" />

As documented here on phonegap community. It would be really helpful if the Phonegap Build documentation was updated accordingly.

like image 84
Andy Polhill Avatar answered Oct 19 '22 21:10

Andy Polhill


I had the same issue almost similar but a bit different :

i had SplashScreenDelay set up correctly so that was fine but u also need to add

<preference name="auto-hide-splash-screen" value="false" />

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

at the start i was only setting up auto-hide-splash-screen and it didnt work , but i guess this was for older versions of phonegap so if that didnt work try adding AutoHideSplashScreen then hopefully it will work .

like image 38
Ashqar Avatar answered Oct 19 '22 20:10

Ashqar