reactjs – React Native Splash Display screen Turning White iOS


I presently have a problem the place on iOS when loading my React Native app the splash display 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, chances are you’ll begin to see a clean display flash between your splash display and the show of your root utility view. If that is so, you’ll be able to add the next code to AppDelegate.m with a purpose to preserve your splash display displayed in the course of 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 resolution for this? I’ve tried wanting round however have not seen something.

Right here is my AppDelegate.mm as nicely.

#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>

@implementation AppDelegate

- (BOOL)utility:(UIApplication *)utility didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.moduleName = @"ProjectMarlin";
  // You may add your customized preliminary props within the dictionary beneath.
  // They are going to be handed all the way 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:@"fundamental" withExtension:@"jsbundle"];
#endif
}

@finish

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles