Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling AutoHideSplashScreen for Android not working

The following Phonegap project (Phonegap Build) is not working:

config.xml:

<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="10000"/>
<gap:plugin name="org.apache.cordova.splashscreen" />

Index:

<head>
<script type="text/javascript" charset="utf-8">

window.location = 'http://www.example.com/login';

 document.AddEventListener("deviceready", OnDeviceReady, false);

    function OnDeviceReady() {
        setTimeout(function() { 
            navigator.splashscreen.hide();
        }, 6000);
    };

   </script>
  </head>

The splash screen stays all the time and loads. The redirecting to the homepage is not working.

I tried this: PhoneGap Build iOS app has blank white screen after splash screen

this: http://community.phonegap.com/nitobi/topics/splash_screen_autohidesplashscreen_false_not_working_iphone_ios7 (Version 0.2.3 of Plugin)

Nothing is working. Any idea?

like image 279
desmeit Avatar asked Nov 29 '14 19:11

desmeit


People also ask

What is SplashScreenDelay?

SplashScreenDelay (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen. <preference name="SplashScreenDelay" value="3000" /> This value used to be in seconds (but is now milliseconds) so values less than 30 will continue to be treated as seconds.

How do I uninstall Cordova plugins?

Removing plugins 'cordova plugin remove cordova-plugin-console' => Removes the console plugin from the project and deletes its entry from config. xml and package. json.

What is Cordova Android?

Cordova Android is an Android application library that allows for Cordova-based projects to be built for the Android Platform. Cordova based applications are, at the core, applications written with web technology: HTML, CSS and JavaScript.


2 Answers

The splashscreen plugin does not support AutoHideSplashScreen for Android. See also this issue: https://issues.apache.org/jira/browse/CB-8396.

As for the redirect not working, try window.location.href = 'http://www.example.com/login';

like image 52
Blaise Avatar answered Oct 28 '22 08:10

Blaise


Fast forward to 2016: This was just recently implemented. You need [email protected] (released Feb 2016)

See https://github.com/apache/cordova-plugin-splashscreen/pull/74

like image 3
jakub.g Avatar answered Oct 28 '22 09:10

jakub.g