Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap Build iOS app has blank white screen after splash screen

Tags:

I'm using PhoneGap Build 3.0, attempting to get rid of the blank white screen that appears after the splash screen.

I've done research and all I can find is references to PhoneGap and Cordova, not PhoneGap Build. None of the things I've tried have worked--mainly, disabling the auto splash screen hide, and hiding it automatically with JavaScript:

In the config.xml:

<feature name="SplashScreen">     <param name="ios-package" value="CDVSplashScreen" />     <param name="onload" value="true" /> </feature> 

In index.html:

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>     <script type="text/javascript" charset="utf-8">         window.location.href = mysite.com          document.AddEventListener("deviceready", OnDeviceReady, false);          function OnDeviceReady() {             setTimeout(function() {                  navigator.splashscreen.hide();             }, 6000);         };     </script> 

But this appears to ignore me and auto-hide the screen regardless. I assume this is because this solution is not for PhoneGap Build, but I'm not sure how else to go about fixing this.

like image 736
Daniel Miller Avatar asked Dec 02 '13 23:12

Daniel Miller


People also ask

Does iOS have splash screen?

Launch screensiOS, iPadOS, and tvOS apps must supply a launch screen. watchOS and macOS apps don't need a launch screen.

What is splash screen plugin?

It is used to notify a user that the program is loading. Furthermore, all the image file formats are not supported for all platforms. To work with the splash screens, you need to use the Splash Screen plugin. This plugin is used to display and hide the splash screen while your app is launching.

What is iOS splash?

Splash Screens for iOSiOS provides developers with a Launch Storyboard to configure their app splash screen designs. This storyboard is helpful for three reasons: It makes it simpler to design for a wide range of device sizes and resolutions. It's required to design splash screens for iPad devices at native ...

What is splash screen in Cordova?

Starting in Android 12, Google has implemented a new SplashScreen API to controls the app launch animation which runs on a device with Android 12 and higher. For backwards compatability, Cordova has included the core-splashscreen compatability library which extends this features back to Android API 21 and higher.


1 Answers

Totally feel your pain on this. The docs for PhoneGap Build need a lot of work. I've been fighting with this the last couple of days myself. After much trial and error, this is what has worked for me.

Within config.xml:

<!-- Do not auto hide splash on iOS --> <preference name="AutoHideSplashScreen" value="false" /> <!-- Do not auto hide splash on Android --> <preference name="SplashScreenDelay" value="10000"/>  <gap:plugin name="org.apache.cordova.splashscreen" /> 

Android does not seem to have an AutoHide param, so we just give it a long delay. We will hide it manually with JS before this 10 seconds is reached.

Adding the plugin reference in the config.xml is needed for the javascript code navigator.splashscreen.hide(); to work.

Also, I found for my project (using Kendo UI Mobile) that no setTimeout delay was needed within onDeviceReady. I am guessing, that once you get the correct params within your config.xml, you will see the same in your app.

My onDeviceReady looks like this:

document.addEventListener('deviceready', function() {   navigator.splashscreen.hide(); }); 

Tested on iOS 6, and Android 4.1 using PhoneGap Build 3.1.

like image 121
Bart Avatar answered Oct 09 '22 02:10

Bart