zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.73k stars 256 forks source link

Feature request: react-native-navigation support #13

Closed Tracklous closed 4 years ago

Tracklous commented 5 years ago

💻 My environment

🕵️‍♂️ Issue is splash screen fluctuates once when JS screen gets mounted..

I followed all your steps but its still happening. Please let me know what to do. I'm using react native navigation. I'm guessing due to react-native-navigation this is happening. Please let me know how to deal with it. Looking forward for your response. Thanks!

MoOx commented 5 years ago

Seems to be a dup of #12

zoontek commented 5 years ago

No, it does not. react-native-navigation system is too complex and too different from classic RN native view handling.

Tracklous commented 5 years ago

Yah! but then how react-native-splash-screen works well with RNN also ?? Is your lib way diff. than react-native-splash-screen implementation ??

zoontek commented 5 years ago

@Tracklous Yes, the implementation is different. I'll take a look at react-native-navigation and see if I can create instructions for it.

vorasudh commented 5 years ago

Is there a solution for this yet? I am using React Native Router Flux which is based on React-Navigation.

I started using this library over react-native-splash-screen because README said no fluctuations.

maxKimoby commented 5 years ago

+1, Screen flashes white after hiding splash and loading Js. Using react-navigation

zoontek commented 5 years ago

@maxKimoby If it's happen with react-navigation (only JS lib), you surely missed a step in the install guide

rabanos-rvc commented 5 years ago

up

vorasudh commented 5 years ago

@maxKimoby If it's happen with react-navigation (only JS lib), you surely missed a step in the install guide

Which step do you think is missed?

vinurs commented 5 years ago

is there any solution for this

zoontek commented 5 years ago

@vinurs Didn't have the time to check, as I'm not using react-native-navigation. I would be happy if someone can help on this.

kevinranks commented 5 years ago

Hope someone can help with this!

MatthewPattell commented 4 years ago

Hello everyone. Try my hot fix

Android 21+ IOS 9+

See README.md for details.

If it works, I will create PR

rtman commented 4 years ago

@MatthewPattell @zoontek any chance we can get a fix for this?

ninjz commented 4 years ago

@MatthewPattell Thanks, this hotfix worked for me. Please submit a PR!

zoontek commented 4 years ago

I studied the case a bit and the solution provided in https://github.com/zoontek/react-native-bootsplash/pull/49 does not suit me: it creates a bunch of usages issues. I'm closing this and added a warning in the README: https://github.com/zoontek/react-native-bootsplash/commit/35cdf62cf2c4cf9cee73d1a8cad457fbf8d31c68

zoontek commented 4 years ago

I have not tested it yet, but version 2.0.2 should supports react-native-navigation just fine: https://github.com/zoontek/react-native-bootsplash/releases/tag/2.0.2

olegdev commented 4 years ago

Please provide some instructions of how to.. My AppDelegate.m with RNN looks like this:

import "AppDelegate.h"

import <React/RCTBundleURLProvider.h>

import <React/RCTRootView.h>

import <ReactNativeNavigation/ReactNativeNavigation.h>

@implementation AppDelegate

@end

arun057 commented 4 years ago

Any updates here?

thobiasn commented 4 years ago

Can you provide an updated example of how to configure AppDelegate.m while using react-native-navigation?

DovletAmanov commented 3 years ago

Is there any instructions to implement this lib alongside with react-native-navigation? Thanks in advance.

mikepaszkiewicz commented 3 years ago

@zoontek Is there a guide for how to do this in version 2.0.2? Thanks in advance!

kiran-kumar011 commented 3 years ago

@zoontek does it supports @react-navigation/native and @react-navigation/stack.

let me know how to make this work with the above packages because i'm not using react-native-navigation.

MoOx commented 3 years ago

@kiran-kumar011 it just work with react-navigation without any particular setup (just follow the readme).

todorone commented 3 years ago

I have not tested it yet, but version 2.0.2 should supports react-native-navigation just fine: https://github.com/zoontek/react-native-bootsplash/releases/tag/2.0.2

Hi @zoontek

It's not clear how to initialize RNBootsplash. When using RNN, we don't have access to rootView, so we can't call: [RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];

Can we make somehow rootView parameter optional to make it work with RNN?

If You can give a hint/direction where to move, i'd be super grateful. Thanks.

ghiculescualexandru commented 2 years ago

@todorone Have you managed to initialize it?

todorone commented 2 years ago

@ghiculescualexandru Unfortunately, no. Seems it does not work well with RNN.

zoontek commented 2 years ago

@todorone @ghiculescualexandru Unfortunately react-native-navigation is not "standard" react-native. They don't expose their internally created RCTRootView.

There's an opened issue on their side: https://github.com/wix/react-native-navigation/issues/6535 And also an open discussion about Android SplashsScreen API: https://github.com/wix/react-native-navigation/discussions/7363

It seems they have an (undocumented) splash screen implem on iOS:

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
[ReactNativeNavigation bootstrapWithBridge:bridge]; // <- should show their RNNSplashScreen

I personally recommend switching to react-navigation v6 + @react-navigation/native-stack (using react-native-screens). Native navigation without the clunkyness.