-
Notifications
You must be signed in to change notification settings - Fork 990
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
Hide the startup screen programmatically & Show loading animation on startup screen #946
Comments
I'm not sure if this changed in cordova-ios@6 but this is what I do in my apps: config.xml: <preference name="AutoHideSplashScreen" value="false" /> This will make it so the splashscreen never disappears until you explicitly tell it to, which you can via javascript: navigator.splashscreen.hide(); This allows you to control when to hide the splash screen. For example in my app, before I show my own UI I first check if the user has stored credentials, and if so load the main screen first. Otherwise load the login screen. Only then I hide the splashscreen.
I think android supports this, but not sure about iOS. Do note that splash screens are images that gets displayed, so there will be a brief period where there is going to be a still image. This is the time between app launch and native code actually executing. While the splashscreen code has been migrated away from the plugin, I believe the documentation still applies |
@breautek Thanks for your reply, I still have some questions.
How to import The documentation for
I did not set ShowSplashScreenSpinner to false. When I used |
This may be a bug, but I don't have apple hardware to test with so I'm afraid I won't be helpful here. |
The spinner on the splashscreen is no longer support in Cordova-iOS 6.0 due to the move to Launch Storyboards. |
Sounds like a workaround to the spinner then is a webview-based implementation. The native splashscreen could be hidden after a webview-based splashscreen is loaded in, which has the flexibility of adding whatever what you want. However, I would rather this be handled at the app level, not at the framework level. |
If the static image of the splashscreen stays too long without a spinner, the user may immediately shut down the App, especially for new users who have just downloaded the App. If there is no better solution, I will consider hiding the splashscreen after starting the WebView, then display some animations so that the user will not think the app is unresponsive. In general, users prefer to wait while loading animations. If the screen is displayed for too long, the user will think that the application is unresponsive. |
These changes should be described in the documentation. |
I know Apple's intention behind storyboards is for you to build a replication of the UI, with content unfilled. I don't think they intend to have animations happening here. They explain their rationale But doing what they suggest is difficult when you don't build your UI with the native tooling, because we aren't using native UI. So I think, the best alternative is to hide the native splashscreen as soon as possible, even if that just simply reveals a web-based splashscreen with a spinner. And I agree this should be documented, and I'll leave this open for this reason. PRs are welcome. |
After loading the WebView, a page with the same background as the splashscreen image is displayed. This page has an animation similar to the spinner, and then close the splashscreen programmatically to hide this page. If an auto-hide splashscreen is set, you can set a timeout on this page, and then automatically hide this "fake" splash screen page at the set time. Intuitively, this is ideal, this can be seen as a splashscreen with spinner displayed immediately after WebView is started. |
I have the same problem; on Android, calling navigator.splashscreen.hide() hides the splash screen correctly. On iOS (with Cordova-ios 6.1.0), calling navigator.splashscreen.hide() does nothing. The value of SplashScreenDelay seems to take effect regardless of the value of AutoHideSplashScreen. |
@michaelhodgins same issue here. To hide the splashscreen when app was ready, set AutoHideSplashScreen to True and SplashScreenDelay to a low number |
@michaelhodgins What version of I suspect you still have the plugin As iOS 6.x has the splashscreen code integrated into its core, and if you are using an older version of the splashscreen plugin, it might be possible that there is conflicts. I had also noticed before the I would recommend checking that you have installed Also make sure to use Cordova-iOS 6.1.0 as it contains some SplashScreen fixes. If you have it installed, I would also recommend trying with a clean start as there might be leftover files conflicting.
After this, NOTE: this will clean out and reinstall @Shay-repos this might also apply to you. |
I'm using <preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="100000000" /> doesn't work. (it used to work with < 6) When I remove the <preference name="AutoHideSplashScreen" value="false" />
<!-- <preference name="SplashScreenDelay" value="100000000" /> --> |
We're seeing the same. We have cases where we want hide the splash screen ourselves during startup, but we also have the SplashScreenDelay as a backstop, to handle some other startup scenarios. With the latest plugin it seems like you get one or the other. You can't manually call |
In case anyone else is like us, desiring both the ability to call
|
Actually,
In case someone use the same version facing the same problem. |
I've marked this issue as stale because it's been over a year with no further comments. If this is still an issue in the latest cordova-ios version and an up-to-date iOS version, please let us know. Otherwise, this issue will be closed. |
Closing as stale. |
Problem
What is expected to happen?
I can hide the splash screen programmatically.
There should be a loading animation on the initial screen.
What does actually happen?
I can't find any way to hide the splash screen programmatically now.
There is no loading animation on the splash screen.
Information
Every time I start the App in my project, I need to log in automatically. After the login is successful, I hide the splash screen and ROOT to the home page. Now I can't find any way to hide the splash screen programmatically.
When I set the auto-hide splash screen in config.xml, if the login is performed faster, a short white screen will be displayed. If I turn off the auto-hide splash screen, when I have successfully logged in and navigate ROOT, about The splash screen was hidden after 3 seconds.
What should I do?
Command or Code
Environment, Platform, Device
cordova-ios@6.1.0
Version information
Checklist
The text was updated successfully, but these errors were encountered: