Skip to content
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

Cannot disable splashscreen in standalone CDVViewController #929

Closed
3 tasks done
sherburne opened this issue Jun 30, 2020 · 7 comments · Fixed by #1014
Closed
3 tasks done

Cannot disable splashscreen in standalone CDVViewController #929

sherburne opened this issue Jun 30, 2020 · 7 comments · Fixed by #1014
Milestone

Comments

@sherburne
Copy link

Bug Report

Problem

According to the Cordova Splashscreen documentation, iOS apps should be able to disable the Cordova-provided launch splashscreen by setting SplashScreenDelay to 0 and FadeSplashScreenDuration to 0. As of 6.1.0, these settings no longer have that effect. createLaunchView in CDVViewController.m does not inspect these settings before instantiating the launch storyboard.

Reference:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/index.html#launch-storyboard-images

5.1.x...6.1.x#diff-3d962b8f101cacedea7abce2ca246eac

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
sherburne added a commit to sherburne/cordova-ios that referenced this issue Jun 30, 2020
@dpogue
Copy link
Member

dpogue commented Jun 30, 2020

A Launch storyboard is a required part of every iOS app. It's not possible to disable entirely.

The default behaviour for Cordova is intended to show a blank screen until the web content loads.

@dpogue dpogue closed this as completed Jun 30, 2020
@sherburne
Copy link
Author

sherburne commented Jun 30, 2020

Okay - Looks like the Cordova documentation is stale then? I'm using Cordova as part of a broader native iOS project; that code manages the appearance of the splash screen. Is there a better way to disable the Cordova splash screen code that you'd recommend?

@breautek
Copy link
Contributor

I believe the default behaviour is a splashscreen is shown for 3 seconds (in addition to however long it takes for the OS to launch the app).

The documentation you linked just disables the delay, but not the splashscreen. Did you mean disabling the delay no longer works in 6.x?

@sherburne
Copy link
Author

Here's what I'm readin in the documentation that I linked to:

To disable the splashscreen add the following preference to config.xml: <preference name="SplashScreenDelay" value="0">
...
iOS Quirk: to disable the splashscreen on ios platform you should also add <preference name="FadeSplashScreenDuration" value="0"/> to config.xml.

I'm interpreting "disable" as "the cordova code won't show the splash screen, period". I've been using Cordova inside a native app for the past year, and I hadn't seen any contention over the splash screen until the upgrade from 5.0.0 to 6.1.0.

Of course I can fork the 6.1.0 code but I'd really like to avoid that for obvious reasons. Another approach I'd considered is subclassing CDVViewController, but createLaunchView and launchView are private so that won't help either. I'm continuing to look at other possibilities.

@dpogue
Copy link
Member

dpogue commented Jun 30, 2020

yeah, I think this is a valid issue when using CDVViewController as part of another application. It will unconditionally show the LaunchStoryboard/blank screen until the web page has loaded.

None of those existing preferences sound like they properly capture what you're actually trying to do here, so we might want to add a new one specific to this use case.

@dpogue dpogue reopened this Jun 30, 2020
@dpogue dpogue changed the title Cannot disable splashscreen as of Cordova iOS 6.x Cannot disable splashscreen in standalone CDVViewController Jun 30, 2020
@sherburne
Copy link
Author

Thanks, that would be a big help. Let me know if there's anything I can do to make this happen.

@j-crosson
Copy link

I mentioned this issue in passing in a CDVViewController-leak bug report (920). Glad the issue is being addressed, guess I should have reported this as a separate issue. I have an ugly workaround that I'll use if a fix doesn't come out before I ship. Since "private" isn't really private in Objective-C, I exposed “launchView” which I replace in my subclassed ViewController “viewDidLoad”.

dpogue added a commit to dpogue/cordova-ios that referenced this issue Oct 28, 2020
When using CDVViewController via CordovaLib as a library, the app might
already be loaded and not need to show the launch storyboard again.

Rather than unconditionally showing the splashscreen until the webview
content has loaded, make it initially invisible. Then in the project
template, make it visible so that it continues working as expected for
apps using the Cordova CLI.

Closes apache#929.
NiklasMerz pushed a commit that referenced this issue Jan 31, 2021
When using CDVViewController via CordovaLib as a library, the app might
already be loaded and not need to show the launch storyboard again.

Rather than unconditionally showing the splashscreen until the webview
content has loaded, make it initially invisible. Then in the project
template, make it visible so that it continues working as expected for
apps using the Cordova CLI.

Closes #929.
@dpogue dpogue added this to the 6.2.0 milestone Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants