9

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?

Community
  • 1
  • 1
desmeit
  • 550
  • 1
  • 7
  • 24

3 Answers3

3

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';

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Blaise
  • 13,139
  • 9
  • 69
  • 97
3

Fast forward to 2016: This was just recently implemented. You need cordova-plugin-splashscreen@3.2.0 (released Feb 2016)

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

jakub.g
  • 38,512
  • 12
  • 92
  • 130
-1

If you want disable the splashscreen, you should add onDeviceReady in the body of http://www.example.com/login

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
neoslink
  • 1
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/10233538) – Lawrence Aiello Nov 17 '15 at 14:28
  • @LawrenceAiello This isn't a link-only answer. example.com isn't a real site. – Kenster Nov 17 '15 at 14:40