iosswiftreact-nativesplash-screen

React Native splash screen on ios


I am developing an app using react native and trying to add a splash screen on ios. I have added the following code on AppDelegate.mm

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.moduleName = @"eCare";
  // You can add your custom initial props in the dictionary below.
  // They will be passed down to the ViewController used by React Native.
  self.initialProps = @{};
  [RNSplashScreen show]; //Added this line

  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

My app is stuck in the splash screen after this. I hid the splash screen on the root screen of react native. I followed the official guide here


Solution

  • I took a look at the doc of the lib and I saw a difference of your code of the AppDelegate. See that at the end of the method didFinishLaunchWithOptions, there is a return YES, try to put this instead of return [super application:application didFinishLaunchingWithOptions:launchOptions]; and see if it works. If it doesn't work please answer so we can try to find another answer.

    enter image description here