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

Possible to start without rootView #14

Open
guns2410 opened this issue Jun 14, 2017 · 3 comments
Open

Possible to start without rootView #14

guns2410 opened this issue Jun 14, 2017 · 3 comments

Comments

@guns2410
Copy link
Contributor

Looking at the code, it seems that RNWorkers require bridge from the rootView.

It is possible to have another start function that accepts the bridge as the parameter. Possibly like:

- (void) startWorkersWithBridge: (RCTBridge *) bridge
{
  mainBridge = bridge;
  if([simulationEnabled boolValue] == YES){
    [self fillDictionaryWithMainBridge];
  }
}

My Objective C skills are not so good. So please excuse me if there seems to be something silly here 😬

@fabriciovergara
Copy link
Owner

Are you planing to communicate between workers directly ?

Yes, it is possible, I only use the mainBridge because I need it to forward messages from worker bridge to main bridge.

But to have the same behavior on Android probably it will be a little painful.

@guns2410
Copy link
Contributor Author

I need it because I am using wix/react-native-navigation which does not have a root View. So my best bet was if it was possible to use it with bridge since it only uses mainBridge of rootView.

@Techwolf12
Copy link

@guns2410 Same one here. Did you manage to get it working? I used this but it either hangs at the splash screen or it doesn't start the workers depending on if [[RNWorkersManager sharedInstance] initWorkerWithPort:8083 bundleRoot:@"index.worker" fallbackResouce:@"worker"]; is placed before or after [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants