question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

[IOS] Stuck on Splash Screen with Code Push

See original GitHub issue

šŸ’» My environment

  • react-native-bootsplash version: 2.2.4
  • react-native version: 0.61.5
  • Platform: ios
  • OS version: 13.5
  • Device: N/A
  • Simulator: Both
  • Android Studio version: N/A
  • Android buildToolsVersion: N/A
  • Xcode version:Ā N/A

šŸ•µļøā€ā™‚ļø Reproducing the issue

I do not have time to create full reproduction repo, but I was facing an issue with Code Push & RNBootsplash hence Iā€™d like to note down my findings:

Setup:

  1. Setup RNBootsplash with simple usage (detail not important):
setTimeout(
  () => RNBootsplash.hide({ duration: 200 }),
  500,
)
  1. Setup RNCodePush with following config:
{
  checkFrequency: RNCodePush.CheckFrequency. ON_APP_START,
  updateDialog: true,
}
  1. Create a native build and CodePush build so that thereā€™s an CodePush update available from the native build.

Steps and Expected Behaviour:

  1. Upon launch, CodePush will automatically check for update
  2. CodePush finds the update, and shows itā€™s native dialog (modal) for update prompt
  3. While 1 & 2 is happening, RNBootsplash will hide the splash screen
  4. Close the App, and reopen the App
  5. CodePush still has context of update available, hence shows the native dialog (modal) for update prompt immediately
  6. While 5 is happening, RNBootsplash should still hide the splash screen behind the scene

Actual Behaviour: 1-4. works as expected 5. native dialog (modal) for update prompt shows for split second, then disappears 6. Screen stuck on the splash screen and cannot proceed

šŸ¤žSolution

Temporal Solution

Identifying this issue took some time, but once identified the temporal ā€œfixā€ was straigthforward. What I did was change the CodePush config to use the following:

{
  checkFrequency: RNCodePush.CheckFrequency. MANUAL,
  updateDialog: true,
}

And call a manual check after RNBootsplash.hide is complete. This avoids the dialog to show while RNBootsplash is still in action. This solution have solved this issue, but it is not the ideal solution.

Ideal Solution (Ask)

I am no expert with native mobile development, but my guess here is that thereā€™s some native view interaction rules of RNBootsplash which is not cooperating well/designed for, while other native view/overlay is in place (In this case, CodePushā€™s native dialog/modal). Based on my assumption, I believe the ideal solution is for RNBootsplash to look for the right native view to interact with while keeping other native views untouched. Apologies if my assumption is out of place, but hope this would at least help others whoā€™s encountering similar issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zoontekcommented, Jun 9, 2020

@rarira Thatā€™s exactly why I work on Promise support. Itā€™ too hard to handle async state with imperative functions and timer. Android support is already done, iOS nearly is.

1reaction
zoontekcommented, Jun 3, 2020

I am no expert with native mobile development, but my guess here is that thereā€™s some native view interaction rules of RNBootsplash which is not cooperating well/designed for, while other native view/overlay is in place (In this case, CodePushā€™s native dialog/modal).

The BootSplash is designed using a simple UIViewController which came above the RCTRootView. Itā€™s standard iOS behavior, there is no magic šŸ˜„

And call a manual check after RNBootsplash.hide is complete. This avoids the dialog to show while RNBootsplash is still in action. This solution have solved this issue, but it is not the ideal solution.

I donā€™t see why? You resolved a race condition. This is not a workaround, but proper handling of this behavior šŸ™‚.

PS: Iā€™m currently working on a new major version with Promises to make it easier to deal with async flow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native app stuck on splash screen on device but works ...
My React Native app works in the XCode simulator with no issues, but when I run in a physical device, my iPhone, there's...
Read more >
App stuck at Splash Screen when restarted to apply code ...
I am using react-native-code-push for OTA updates. As soon as user enters the app there will be check for updates and if there...
Read more >
iOS app stuck on splash screen - mobile - Meteor forums
Hello,. I'm not sure if this is meteor related but, our iOS app works fine on iOS 13, but it's stuck on splash...
Read more >
ionic 5 iOS app stuck on Splash Screen with no error logs
Finally, after trying so many ways, I was able to solve the issue. I have solved the issue by running the below commands...
Read more >
expo go app stuck on splash screen - Cutacut.com
1 You can start by deleting the default icon and splash screen in the assets folder and replace them with your newly created...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found