-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cap 3 beta] Splash Screen: Splash no longer automatically appears on app launch #270
Comments
It was documented on ionic-team/capacitor#3320 (check last edit), but looks like it wasn't added when the information was moved to the official doc page. But since Capacitor 2.1.0, all new projects included |
Updated my description with more detail. It's not about whether it's a breaking change or not, just pointing out that the Splash doesn't appear on launch anymore because that launch duration value now defaults to 0. If that's intentional (aka not a bug), I'd like to know what values to set then, as part of my "open question" thing. thanks. |
Using Capacitor Given two branches of the same application, both containing the same
|
@eric-horodyski could you try if this works for you? Explicitly setting a |
Looks like this is the culprit: Lines 45 to 47 in 72be326
Just did a quick check and I think it should be this instead: if (config.getLaunchShowDuration() == 0 && config.isLaunchAutoHide()) {
return;
} Will check on both Android and iOS and provide a PR later today 👍🏼 |
Additional (iOS): launchAutoHide seems to do nothing currently? capacitor-plugins/splash-screen/ios/Plugin/SplashScreen.swift Lines 26 to 27 in 72be326
I think here the settings.autoHide should be set to config.launchAutoHide
|
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out. |
Bug Report
Plugin(s)
Splash Screen v0.3.3
Capacitor Version
Platform(s)
iOS, Android
Current Behavior
In Cap 3's Splash Screen plugin, launchShowDuration value now defaults to 0 (in Cap 2, it was 3000 which caused apps to potentially be “slower” to load if they in fact loaded faster than 3 seconds). The consequence is that the Splash Screen no longer automatically appears on app launch.
Why? In the code (see here), if 0 is found, the
showOnLaunch()
method exits without doing anything. in SplashScreenConfig (iOS), launchShowDuration defaults to 0.If that's intentional, we should document this change in the upgrade guide because if you’re like me, you never called the Show method, just Hide. According to Dan, this could be a bug though.
To see the splash screen, I added this to the Cap config:
"launchShowDuration": 1000,
"launchAutoHide": false
Expected Behavior
If the Splash screen plugin is installed, on ios/android app launch the screen should display, and no configuration (in capacitor.config.json) is required.
Code Reproduction
Pull Cap 3 branch: https://github.com/ionic-team/ionifits/tree/cap-3
Currently, the splash will show since I've set launchShowDuration to 1000 (aka anything but 0). So, delete
launchShowDuration
entry from Cap config, or set it to zero.Open question: What is the best configuration for fast loading apps?
From this in the Cap 3 docs, we mention hiding the splash to manually provide the fastest experience to users. With this new launch duration change in mind, what is the best practice for fast loading apps?What recommendation can we make to users?
I think we want to recommend showing the splash screen for as long as it takes until the app is ready. That would mean in Cap config, setting
launchAutoHide
to false, then callingHide()
on app startup. In Angular, this would be:The text was updated successfully, but these errors were encountered: