skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. switch return [super application:application didFinishLaunchingWithOptions:launchOptions];

    with the below…

    bool didFinish=[super application:application didFinishLaunchingWithOptions:launchOptions];

    [RNSplashScreen show]; // here return didFinish;

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search