Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: react-native-navigation support #13

Closed
Tracklous opened this issue Aug 12, 2019 · 28 comments
Closed

Feature request: react-native-navigation support #13

Tracklous opened this issue Aug 12, 2019 · 28 comments
Labels
feature request New feature or request help wanted Extra attention is needed

Comments

@Tracklous
Copy link

💻 My environment

  • react-native-bootsplash version: 0.1.1
  • react-native version: 0.60.4
  • Platform: Both
  • OS version: IOS 12.3 / Android Pie
  • Device: Iphone 8 simulator
  • Simulator: yes
  • Android Studio version: 3.4.x
  • Xcode version: 10.3
  • React-Native-Navigation: V3 Alpha 11

🕵️‍♂️ 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
Copy link
Contributor

MoOx commented Aug 13, 2019

Seems to be a dup of #12

@zoontek
Copy link
Owner

zoontek commented Aug 14, 2019

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

@Tracklous
Copy link
Author

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
Copy link
Owner

zoontek commented Aug 18, 2019

@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
Copy link

vorasudh commented Aug 27, 2019

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
Copy link

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

@zoontek
Copy link
Owner

zoontek commented Aug 28, 2019

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

@rabanos-rvc
Copy link

up

@vorasudh
Copy link

vorasudh commented Sep 4, 2019

@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
Copy link

vinurs commented Sep 19, 2019

is there any solution for this

@zoontek
Copy link
Owner

zoontek commented Sep 19, 2019

@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.

@zoontek zoontek added the help wanted Extra attention is needed label Sep 19, 2019
@kevinranks
Copy link

Hope someone can help with this!

@MatthewPattell
Copy link

MatthewPattell commented Nov 29, 2019

Hello everyone.
Try my hot fix

Android 21+
IOS 9+

See README.md for details.

If it works, I will create PR

@rtman
Copy link

rtman commented Dec 18, 2019

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

@ninjz
Copy link

ninjz commented Dec 30, 2019

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

@zoontek zoontek changed the title Does this support react-native-navigation's way ? Splash fluctuates once before JS mounted.. react-native-navigation support Dec 31, 2019
@zoontek zoontek changed the title react-native-navigation support Feature request: react-native-navigation support Dec 31, 2019
@zoontek zoontek added the feature request New feature or request label Dec 31, 2019
@zoontek
Copy link
Owner

zoontek commented Jan 7, 2020

I studied the case a bit and the solution provided in #49 does not suit me: it creates a bunch of usages issues.
I'm closing this and added a warning in the README: 35cdf62

@zoontek zoontek closed this as completed Jan 7, 2020
@zoontek
Copy link
Owner

zoontek commented Mar 7, 2020

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
Copy link

olegdev commented Mar 26, 2020

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

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
    [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];

    return YES;
    }

  • (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
    {
    #if DEBUG
    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
    #else
    return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
    #endif
    }

@EnD

@arun057
Copy link

arun057 commented May 27, 2020

Any updates here?

@thobiasn
Copy link

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

@DovletAmanov
Copy link

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

@mikepaszkiewicz
Copy link

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

@kiran-kumar011
Copy link

@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
Copy link
Contributor

MoOx commented Jul 27, 2021

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

@todorone
Copy link

todorone commented Jul 29, 2021

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
Copy link

@todorone Have you managed to initialize it?

@todorone
Copy link

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

@zoontek
Copy link
Owner

zoontek commented Feb 15, 2022

@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: wix/react-native-navigation#6535
And also an open discussion about Android SplashsScreen API: wix/react-native-navigation#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests