Closed DanielZlotin closed 5 years ago
Can you please provide more information on this issue? Probably it's something that community can help you with?
@Kureev updated
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
I looked into the RNNSpalashScreen
. Below is what I can understand is happening.
show
method tries different ways to get the LaunchImage
or LaunchScreen
and show it as rootViewController
LaunchScreen
storyboard and load it if it is available. In case if failed to load, take the root view from storyboard view controller and load itLaunchImage
by checking Default
or LaunchImage
from assets catalog and loads it.From initial look this is what I can propose, comments or suggestion welcome.
RNNSplashScreen
to RNNSplashViewController
show
. Instead allocate and init in ReactNativeNavigation
or where ever it needs to be accessedLaunchImage
. Once its found check whether image same scale and dimensions as our current device's screen. This way we can support all the devices and screens without hardcoding the dimensions and image names. Probably future proof with all new iDevices and screen sizes. I found this SO answer really helpful. XCTest
to init
the splash view controller and check its root view for launch screen or image. Probably allow injecting the view controller with which way to search splash. (via storyboard or assets)@DanielZlotin
Also, one more thing would like to add is bootstrap the RNN without the splash screen. Probably extra API method which only allocate and set the RNNBridgeManager
. The reason behind this is I have a brownfield app and currently managed to make it work with some custom native code. But I would like to avoid splash when bootstrapping. May be take this as first step to support brownfield apps.
@rizwankce Good debugging! Can you make PR of those changes?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Currently RNNSplashView is a mess (one giant method) and needs some refactoring.
Also, we need tests to make sure custom splash screens are supported (it looks like they are but if something were to break there currently is no way to tell). Testing it won't be easy as we need some way to control it from outside. Maybe xctests are the solution here unfortunately.