Anything inside platform.ready() isn't executed after build


#1

When i launch my app it stucks on the splashscreen for … let’s say infinity …
this is my splashscreen preferences on config.xml

<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />

#3

If you dont hide the splashscreen automatically, you will have to hide it manually in your code. This could be done when, for example, your asynchronous code has returned a value (might be an initial REST-call).

hope this helps


#4

i’m actually doing it manually like this

this.platform.ready().then(() => {
   this.splashScreen.hide();
   this.statusBar.styleDefault(); 
   this.statusBar.backgroundColorByHexString('#f83f6d'); 
   this.statusBar.styleLightContent();
   this.backgroundMode.enable(); 
   this.backgroundMode.setDefaults({ silent: true });
   this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT_PRIMARY);
   this.oneSignal.startInit('App-id, 'Id'); this.oneSignal.endInit();
});

I should have said in the title, anything inside the platform.ready() isn’t executed


#5

how to hide splashscreen automacilly?


#6

<preference name=“AutoHideSplashScreen” value=“true” />


#7

Does platform have the correct value? Are you assigning it in your constructor?

import { Platform } from 'ionic-angular';

@Component({...})
export MyPage {
  constructor(public plt: Platform) {

  }
}

try doing a console.log(plt.versions()); to make sure platform has the correct object.

Next to this, make sure your platform code is in app.compontent.ts constructor, the .ready() method might not be triggered otherwise.

Let me know if anything works, else, you might wanna share a bit more of your code

kind regards