skip to Main Content

By using Splash screen docs, it is not possible to make disappear the splash screen. the app got stuck behind showing the splash screen.

iOS native codes:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.moduleName = @"ttttapp";
  
 [RNSplashScreen show];

  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

Android native codes:

public class MainActivity extends ReactActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    androidx.core.splashscreen.SplashScreen.installSplashScreen(this);
    org.devio.rn.splashscreen.SplashScreen.show(this, true);
    super.onCreate(savedInstanceState);

2

Answers


  1. Chosen as BEST ANSWER

    On the iOS AppDelegate.m file it should be like the following:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {  
      self.moduleName = @"ProjectName";
      // 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 = @{};
      
      bool didFinish=[super application:application didFinishLaunchingWithOptions:launchOptions];
      
      [RNSplashScreen show];  // here
      return didFinish;
    }
    

    On the Android MainActivity.java file should be like this:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
      SplashScreen.show(this);
      super.onCreate(savedInstanceState);
    }
    

    Reference: issue#606


  2. I fix this by modifying my ApDelegate.mm file
    from

       // 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]; 
      return [super application:application didFinishLaunchingWithOptions:launchOptions];
     
    }

    to

     self.initialProps = @{};
      [super application: applicationdidFinishLaunchingWithOptions:launchOptions];
      [RNSplashScreen show]; 
      return YES;
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search