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
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 areturn YES
, try to put this instead ofreturn [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.switch return [super application:application didFinishLaunchingWithOptions:launchOptions];
with the below…
bool didFinish=[super application:application didFinishLaunchingWithOptions:launchOptions];
[RNSplashScreen show]; // here return didFinish;