How to remove white blank screen of splash from the ionic2 application? - ionic-framework

I am trying to remove default splash screen from ionic 2 application, and for that I used the property <preference name="SplashScreen" value="none" /> and the command cordova plugin -rm cordova-plugin-splashscreen, although that combination removed the splash but not completely, and I am still getting a blank white screen while launching the application.
How do I get rid of from the blank white screen?

Config.xml
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="SplashReloadOnOrientationChange" value="true" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
add these above lines
And in app.component.ts:
if (this.splashScreen) {
setTimeout(() => {
this.splashScreen.hide();
}, 100);
}
also build the app using command
ionic cordova build andorid --prod

Put it on the second line of your main.ts:
import { enableProdMode } from '#angular/core';
Then, before ...bootstrapModule... in your main.ts add this line:
enableProdMode();
I hope it will work.

Related

Ionic 3: keyboard hiding the inputs

I'm working with Ionic 3 in a project, and after I finished the frontEnd I notice that when I click on input, the keyboard overlaps the ionic webview, instead resize it to show the content correctly, so the user can't see what he typing.
here is my config.xml
<preference name="fullscreen" value="false" />
<preference name="StatusBarOverlaysWebView" value="true" />
<preference name="KeyboardResize" value="true" />
<preference name="KeyboardResizeMode" value="native" />
<preference name="android-windowSoftInputMode" value="adjustPan|stateAlwaysHidden" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
AndroidManifest.xml
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="#android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustPan">
Someone already had this problem before?
Thanks for help!
Here is an image of the problem:

Ionic app got stuck on white screen after splash screen

I have developed one ionic application, which get stucks after splash screen. App continuously shows white screen.
My code from confid file is as below
<preference name="SplashScreen" value="screen" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="OverrideUserAgent" value="Chrome/41.0.2228.0" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="ShowSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ScrollEnabled" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
Typically in the app.component.ts class constructor:
this.platform.ready().then(() => {
this.splashScreen.hide();
});
Please help me
try to change this to
<preference name="SplashScreenDelay" value="75000" />

White screen shows instead of splash screen --ionic 4

I am working on a project in ionic 4 ,when i try to change the icon and splash screen of my own .i replace my icon with icon.png and splash with splash.png after ionic Cordova resources run. app icon is successfully replaced with my new icon in icon folder and splash screen also replaced with my new screen in splash folder, after build android the icon is changed but the splash screen is not visible at all only a white screen shows for 5-7 sec and then show my app's home page. if anyone know how to solve that please let my know.
I remember struggling with that issue as well, it was solved by adding some preferences in the config.xml.
This is in my current (ionic 3) project, hope this helps.
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="FadeSplashScreen" value="true" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="30000" />
<preference name="ShowSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
EDIT
Also make sure you have the cordova splashscreen plugin installed
ionic cordova plugin add cordova-plugin-splashscreen
npm install --save #ionic-native/splash-screen

thread warnings in Phonegap/Cordova app

I am getting these two thread warnings compiling on an iPhone (iOS 6):
THREAD WARNING: ['InAppBrowser'] took '260.519043' ms. Plugin should use a background thread.
THREAD WARNING: ['Geolocation'] took '110.953857' ms. Plugin should use a background thread.
this is how I call the plugins in my code:
window.open("http://www.anaddress.com", '_system');
and this is how my config.xml looks like:
<?xml version='1.0' encoding='utf-8'?>
<widget id="my.id" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Hello Cordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<access origin="*" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value=".25" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
<feature name="Geolocation">
<param name="ios-package" value="CDVLocation" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<author email="mail#exam.de" href="http://www.example.com">Me
</author>
<content src="index.html" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
</widget>
Of course I installed the plugins using the cordova CLI:
$ cordova plugin add org.apache.cordova.inappbrowser
Any help would be appreciated, Thanks!
Look at the Phonegap Documentation and search for "Threading"
They explain that you might want to run the thread in the Background instead of the main one.
Apple doesn't like Blocked UI so you need to find a way to cancel your call if it takes more than 10 milliseconds.
Although you are not getting errors, just warnings.

Splash Screen scrolling up after about one second with phonegap 3.0.0 in iOS

I've a problem with iOS splashscreen I use phonegap 3.0.0, jquery mobile, backbone.
My config.xml out of www folder is:
<preference name="DisallowOverscroll" value="true" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="EnableLocation" value="true" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
in index.html I've
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
function onDeviceReady() {
setTimeout(function() {
navigator.splashscreen.hide();
}, 2000);
}
</script>
For first second I've fullscreen splashsreen
for the next two seconds, splashscreen scroll up about 20px
I have tested it in all iOS simulator:iPhone, iPhone retina, iPhone retina 4-inch...
and in iOS 5.1/7.0
Solutions?
Best bet is to update to 3.1, they've fixed the splash screen plugin at that level to resolve this issue.
Or check our this post here