Fix show in iOS
This commit fixes show function, which does not bring back splash screen in iOS.
This is something working; It brings a new limitation: call in ios level should be to showSplash function instead show
This is something working; It brings a new limitation: call in ios level should be to showSplash function instead show
This PR doesn't work for me... When you mention showSplash, do you mean this one in AppDelegate.m? Or from actual JS code??
...
[super application:application didFinishLaunchingWithOptions:launchOptions];
// Used to be show [RNSplashScreen show];
[RNSplashScreen showSplash];
return YES;
}
@OneStromberg You r right! It has to be [RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView]; now.
@crazycodeboy Please merge this PR in. This works perfectly.
For any EXPO bare users who are looking forward to applying this PR, there is where you should put that [RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView]; line in AppDelegate.m:
- (RCTBridge *)initializeReactNativeApp
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:self.launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
// HERE!!!!*****************************
[RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView];
// *****************************
return bridge;
}
Also, don't forget to update LaunchScreen.xib file in the way u want!(Make it looks like your SplashScreen) Otherwise your splash screen will be like My App Powered by React Native with white background. 😂😂😂

it does not work. the app was forced out