I at present have a problem the place on iOS when loading my React Native app the splash display screen will solely seem for a second earlier than turning white. I see on the React Native doucmentation an answer to this but it surely seems out dated. There’s not longer and AppDelegate.m simply an AppDelegate.mm.
Documentation “As your App Bundle grows in dimension, you might begin to see a clean display screen flash between your splash display screen and the show of your root software view. If that is so, you may add the next code to AppDelegate.m in an effort to preserve your splash display screen displayed throughout the transition.”
// Place this code after "[self.window makeKeyAndVisible]" and earlier than "return YES;"
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *vc = [sb instantiateInitialViewController];
rootView.loadingView = vc.view;
Is there a contemporary answer for this? I’ve tried trying round however have not seen something.
Right here is my AppDelegate.mm as effectively.
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
@implementation AppDelegate
- (BOOL)software:(UIApplication *)software didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"ProjectMarlin";
// You'll be able to add your customized preliminary props within the dictionary beneath.
// They are going to be handed right down to the ViewController utilized by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"important" withExtension:@"jsbundle"];
#endif
}
@finish