react-native-threads
react-native-threads copied to clipboard
Using main bundle instead of thread bundle in iOS release mode (react-native 0.68.1)
I believe this change broke using the correct thread bundle in iOS release mode with react-native 0.68.1, and instead using the main bundle:
THREAD NAME App/Workers/my_worker // <-- correct path
starting Thread: file:///Users/.../Library/Developer/CoreSimulator/Devices/.../my-app.app/main.jsbundle // <-- wrong bundle
Anyone has a suggestion for a fix?
Here is a possible fix in ThreadManager.m but probably not the best one:
//NSURL *threadURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:name fallbackResource:name];
NSURL *threadURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:name fallbackURLProvider:^NSURL * {
return [[NSBundle mainBundle] URLForResource:name withExtension:@"jsbundle"];
}];
Can confirm this fixes things for RN 68. I had tried another suggestion of simply removing the fallbackResource
param, but that used the wrong bundle for the thread.