Skip to content

Commit cb2d93e

Browse files
[RN][iOS] Cherry Pick #43757 and #43994 (#44007)
* Support launchOptions in bridgeless mode (#43757) Summary: Support launchOptions in bridgeless mode bypass-github-export-checks [IOS] [FIXED] - Support launchOptions in bridgeless mode Pull Request resolved: #43757 Test Plan: ``` useEffect(() => { const processInitialURL = async () => { const url = await Linking.getInitialURL(); if (url !== null) { console.log(`Initial url is: ${url}`); } }; processInitialURL(); }, []); ``` Reviewed By: javache Differential Revision: D55790758 Pulled By: cipolleschi fbshipit-source-id: 0f6aa6bdcebfc5bc42d632bea9193f122c1eb84f * Fix Connect to Metro after Reload in Bridgeless mode (#43994) Summary: Pull Request resolved: #43994 We received [this issue](#43764) from OSS where an app can't connect to Metro on reloads in the following scenario: * Start the App when metro does not run. * Observe the error screen * Start Metro * Press Reload * Observe the error message again While the desired behavior should be to connect to Metro now that this is running. The root cause of the problem is that the RCTHost is initialized with a value of the `bundleURL` that is `nil`. Upon reload, the RCTHost is **not** recreated: the instance is restarted, but with the previous `bundleURL`, which is still `nil`. The solution is to initialize the `RCTHost` with a closure that re-evaluate the `bundleURL` whenever it is invoked and to evaluate it only on `start`, to keep the initialization path light. This way, when the app is started with Metro not running, the `bundleURL` is `nil`. But when it is reloaded with Metro starting, the `bundleURL` is properly initialized. Note that the changes in this diff are not breaking as I reimplemented (and deprecated) the old initializer so that they should work in the same way. [iOS][Fixed] - Let RCTHost be initialized with a function to provide the `bundleURL` so that it can connect to metro on Reload when the url changes. Reviewed By: dmytrorykun Differential Revision: D55916135 fbshipit-source-id: 6927b2154870245f28f42d26bd0209b28c9518f2 * Fix badly resolved merge conflicts --------- Co-authored-by: zhongwuzw <zhongwuzw@qq.com>
1 parent 2d84d83 commit cb2d93e

File tree

16 files changed

+207
-133
lines changed

16 files changed

+207
-133
lines changed

packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,18 @@ - (Class)getModuleClassFromName:(const char *)name
233233

234234
- (RCTRootViewFactory *)createRCTRootViewFactory
235235
{
236+
__weak __typeof(self) weakSelf = self;
237+
RCTBundleURLBlock bundleUrlBlock = ^{
238+
RCTAppDelegate *strongSelf = weakSelf;
239+
return strongSelf.bundleURL;
240+
};
241+
236242
RCTRootViewFactoryConfiguration *configuration =
237-
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURL:self.bundleURL
238-
newArchEnabled:self.fabricEnabled
239-
turboModuleEnabled:self.turboModuleEnabled
240-
bridgelessEnabled:self.bridgelessEnabled];
243+
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock
244+
newArchEnabled:self.fabricEnabled
245+
turboModuleEnabled:self.turboModuleEnabled
246+
bridgelessEnabled:self.bridgelessEnabled];
241247

242-
__weak __typeof(self) weakSelf = self;
243248
configuration.createRootViewWithBridge = ^UIView *(RCTBridge *bridge, NSString *moduleName, NSDictionary *initProps)
244249
{
245250
return [weakSelf createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ typedef UIView *_Nonnull (
2323
^RCTCreateRootViewWithBridgeBlock)(RCTBridge *bridge, NSString *moduleName, NSDictionary *initProps);
2424
typedef RCTBridge *_Nonnull (
2525
^RCTCreateBridgeWithDelegateBlock)(id<RCTBridgeDelegate> delegate, NSDictionary *launchOptions);
26+
typedef NSURL *_Nullable (^RCTSourceURLForBridgeBlock)(RCTBridge *bridge);
27+
typedef NSURL *_Nullable (^RCTBundleURLBlock)(void);
28+
typedef NSArray<id<RCTBridgeModule>> *_Nonnull (^RCTExtraModulesForBridgeBlock)(RCTBridge *bridge);
29+
typedef NSDictionary<NSString *, Class> *_Nonnull (^RCTExtraLazyModuleClassesForBridge)(RCTBridge *bridge);
30+
typedef BOOL (^RCTBridgeDidNotFindModuleBlock)(RCTBridge *bridge, NSString *moduleName);
2631

2732
#pragma mark - RCTRootViewFactory Configuration
2833
@interface RCTRootViewFactoryConfiguration : NSObject
@@ -37,7 +42,7 @@ typedef RCTBridge *_Nonnull (
3742
@property (nonatomic, assign, readonly) BOOL turboModuleEnabled;
3843

3944
/// Return the bundle URL for the main bundle.
40-
@property (nonatomic) NSURL *bundleURL;
45+
@property (nonatomic, nonnull) RCTBundleURLBlock bundleURLBlock;
4146

4247
/**
4348
* Use this method to initialize a new instance of `RCTRootViewFactoryConfiguration` by passing a `bundleURL`
@@ -48,10 +53,15 @@ typedef RCTBridge *_Nonnull (
4853
* pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`.
4954
*
5055
*/
56+
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
57+
newArchEnabled:(BOOL)newArchEnabled
58+
turboModuleEnabled:(BOOL)turboModuleEnabled
59+
bridgelessEnabled:(BOOL)bridgelessEnabled NS_DESIGNATED_INITIALIZER;
60+
5161
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
5262
newArchEnabled:(BOOL)newArchEnabled
5363
turboModuleEnabled:(BOOL)turboModuleEnabled
54-
bridgelessEnabled:(BOOL)bridgelessEnabled;
64+
bridgelessEnabled:(BOOL)bridgelessEnabled __deprecated;
5565

5666
/**
5767
* Block that allows to override logic of creating root view instance.

packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,23 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL
5757
newArchEnabled:(BOOL)newArchEnabled
5858
turboModuleEnabled:(BOOL)turboModuleEnabled
5959
bridgelessEnabled:(BOOL)bridgelessEnabled
60+
{
61+
return [self
62+
initWithBundleURLBlock:^{
63+
return bundleURL;
64+
}
65+
newArchEnabled:newArchEnabled
66+
turboModuleEnabled:turboModuleEnabled
67+
bridgelessEnabled:bridgelessEnabled];
68+
}
69+
70+
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
71+
newArchEnabled:(BOOL)newArchEnabled
72+
turboModuleEnabled:(BOOL)turboModuleEnabled
73+
bridgelessEnabled:(BOOL)bridgelessEnabled
6074
{
6175
if (self = [super init]) {
62-
_bundleURL = bundleURL;
76+
_bundleURLBlock = bundleURLBlock;
6377
_fabricEnabled = newArchEnabled;
6478
_turboModuleEnabled = turboModuleEnabled;
6579
_bridgelessEnabled = bridgelessEnabled;
@@ -123,7 +137,7 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName
123137
RCTEnableTurboModuleInterop(YES);
124138
RCTEnableTurboModuleInteropBridgeProxy(YES);
125139

126-
[self createReactHostIfNeeded];
140+
[self createReactHostIfNeeded:launchOptions];
127141

128142
RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:moduleName initialProperties:initProps];
129143

@@ -206,19 +220,20 @@ - (void)createBridgeAdapterIfNeeded
206220

207221
#pragma mark - New Arch Utilities
208222

209-
- (void)createReactHostIfNeeded
223+
- (void)createReactHostIfNeeded:(NSDictionary *)launchOptions
210224
{
211225
if (_reactHost) {
212226
return;
213227
}
214228

215229
__weak __typeof(self) weakSelf = self;
216-
_reactHost = [[RCTHost alloc] initWithBundleURL:[self bundleURL]
217-
hostDelegate:nil
218-
turboModuleManagerDelegate:_turboModuleManagerDelegate
219-
jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
220-
return [weakSelf createJSRuntimeFactory];
221-
}];
230+
_reactHost = [[RCTHost alloc] initWithBundleURLProvider:self->_configuration.bundleURLBlock
231+
hostDelegate:nil
232+
turboModuleManagerDelegate:_turboModuleManagerDelegate
233+
jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
234+
return [weakSelf createJSRuntimeFactory];
235+
}
236+
launchOptions:launchOptions];
222237
[_reactHost setBundleURLProvider:^NSURL *() {
223238
return [weakSelf bundleURL];
224239
}];
@@ -247,7 +262,7 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
247262

248263
- (NSURL *)bundleURL
249264
{
250-
return self->_configuration.bundleURL;
265+
return self->_configuration.bundleURLBlock();
251266
}
252267

253268
@end

packages/react-native/React/Base/RCTBridgeProxy.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#import "RCTBridgeModule.h"
1111

12+
NS_ASSUME_NONNULL_BEGIN
13+
1214
@class RCTBundleManager;
1315
@class RCTCallableJSModules;
1416
@class RCTModuleRegistry;
@@ -22,7 +24,8 @@
2224
callableJSModules:(RCTCallableJSModules *)callableJSModules
2325
dispatchToJSThread:(void (^)(dispatch_block_t))dispatchToJSThread
2426
registerSegmentWithId:(void (^)(NSNumber *, NSString *))registerSegmentWithId
25-
runtime:(void *)runtime NS_DESIGNATED_INITIALIZER;
27+
runtime:(void *)runtime
28+
launchOptions:(nullable NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER;
2629

2730
- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel;
2831
- (void)forwardInvocation:(NSInvocation *)invocation;
@@ -37,3 +40,5 @@
3740
- (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad;
3841

3942
@end
43+
44+
NS_ASSUME_NONNULL_END

packages/react-native/React/Base/RCTBridgeProxy.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ @implementation RCTBridgeProxy {
3535
RCTModuleRegistry *_moduleRegistry;
3636
RCTBundleManager *_bundleManager;
3737
RCTCallableJSModules *_callableJSModules;
38+
NSDictionary *_launchOptions;
3839
void (^_dispatchToJSThread)(dispatch_block_t);
3940
void (^_registerSegmentWithId)(NSNumber *, NSString *);
4041
void *_runtime;
@@ -47,6 +48,7 @@ - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
4748
dispatchToJSThread:(void (^)(dispatch_block_t))dispatchToJSThread
4849
registerSegmentWithId:(void (^)(NSNumber *, NSString *))registerSegmentWithId
4950
runtime:(void *)runtime
51+
launchOptions:(nullable NSDictionary *)launchOptions
5052
{
5153
self = [super self];
5254
if (self) {
@@ -57,6 +59,7 @@ - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
5759
_dispatchToJSThread = dispatchToJSThread;
5860
_registerSegmentWithId = registerSegmentWithId;
5961
_runtime = runtime;
62+
_launchOptions = [launchOptions copy];
6063
}
6164
return self;
6265
}
@@ -191,8 +194,7 @@ - (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path
191194

192195
- (NSDictionary *)launchOptions
193196
{
194-
[self logError:@"This method is not supported. Returning nil." cmd:_cmd];
195-
return nil;
197+
return _launchOptions;
196198
}
197199

198200
- (BOOL)loading

packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ - (BOOL)_shouldCreateObjCModule:(Class)moduleClass
674674
*/
675675
if (_bridge) {
676676
[(id)module setValue:_bridge forKey:@"bridge"];
677-
} else if (_bridgeProxy && [self _isLegacyModuleClass:[module class]]) {
677+
} else if (_bridgeProxy) {
678678
[(id)module setValue:_bridgeProxy forKey:@"bridge"];
679679
}
680680
} @catch (NSException *exception) {

packages/react-native/ReactCommon/react/runtime/iostests/RCTHostTests.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ - (void)setUp
5858
turboModuleManagerDelegate:OCMProtocolMock(@protocol(RCTTurboModuleManagerDelegate))
5959
jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
6060
return std::make_shared<facebook::react::RCTHermesInstance>();
61-
}];
61+
}
62+
launchOptions:nil];
6263
}
6364

6465
- (void)tearDown

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost+Internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
#import "RCTContextContainerHandling.h"
1111

12-
typedef NSURL * (^RCTHostBundleURLProvider)(void);
13-
1412
@interface RCTHost (Internal)
1513

1614
- (void)registerSegmentWithId:(NSNumber *)segmentId path:(NSString *)path;

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
2121

2222
@protocol RCTTurboModuleManagerDelegate;
2323

24+
typedef NSURL *_Nullable (^RCTHostBundleURLProvider)(void);
25+
2426
// Runtime API
2527

2628
@protocol RCTHostDelegate <NSObject>
@@ -45,10 +47,17 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
4547

4648
@interface RCTHost : NSObject
4749

50+
- (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider
51+
hostDelegate:(id<RCTHostDelegate>)hostDelegate
52+
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
53+
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
54+
launchOptions:(nullable NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER;
55+
4856
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
4957
hostDelegate:(id<RCTHostDelegate>)hostDelegate
5058
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
51-
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider NS_DESIGNATED_INITIALIZER;
59+
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
60+
launchOptions:(nullable NSDictionary *)launchOptions __deprecated;
5261

5362
@property (nonatomic, weak, nullable) id<RCTHostRuntimeDelegate> runtimeDelegate;
5463

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ @implementation RCTHost {
5858
RCTHostBundleURLProvider _bundleURLProvider;
5959
RCTHostJSEngineProvider _jsEngineProvider;
6060

61+
NSDictionary *_launchOptions;
62+
6163
// All the surfaces that need to be started after main bundle execution
6264
NSMutableArray<RCTFabricSurface *> *_surfaceStartBuffer;
6365
std::mutex _surfaceStartBufferMutex;
@@ -77,14 +79,31 @@ + (void)initialize
7779
_RCTInitializeJSThreadConstantInternal();
7880
}
7981

80-
/**
81-
Host initialization should not be resource intensive. A host may be created before any intention of using React Native
82-
has been expressed.
83-
*/
8482
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
8583
hostDelegate:(id<RCTHostDelegate>)hostDelegate
8684
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
8785
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
86+
launchOptions:(nullable NSDictionary *)launchOptions
87+
{
88+
return [self
89+
initWithBundleURLProvider:^{
90+
return bundleURL;
91+
}
92+
hostDelegate:hostDelegate
93+
turboModuleManagerDelegate:turboModuleManagerDelegate
94+
jsEngineProvider:jsEngineProvider
95+
launchOptions:launchOptions];
96+
}
97+
98+
/**
99+
Host initialization should not be resource intensive. A host may be created before any intention of using React Native
100+
has been expressed.
101+
*/
102+
- (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider
103+
hostDelegate:(id<RCTHostDelegate>)hostDelegate
104+
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
105+
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
106+
launchOptions:(nullable NSDictionary *)launchOptions
88107
{
89108
if (self = [super init]) {
90109
_hostDelegate = hostDelegate;
@@ -93,9 +112,9 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL
93112
_bundleManager = [RCTBundleManager new];
94113
_moduleRegistry = [RCTModuleRegistry new];
95114
_jsEngineProvider = [jsEngineProvider copy];
115+
_launchOptions = [launchOptions copy];
96116

97117
__weak RCTHost *weakSelf = self;
98-
99118
auto bundleURLGetter = ^NSURL *()
100119
{
101120
RCTHost *strongSelf = weakSelf;
@@ -107,7 +126,7 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL
107126
};
108127

109128
auto bundleURLSetter = ^(NSURL *bundleURL_) {
110-
[weakSelf _setBundleURL:bundleURL];
129+
[weakSelf _setBundleURL:bundleURL_];
111130
};
112131

113132
auto defaultBundleURLGetter = ^NSURL *()
@@ -120,7 +139,6 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL
120139
return strongSelf->_bundleURLProvider();
121140
};
122141

123-
[self _setBundleURL:bundleURL];
124142
[_bundleManager setBridgelessBundleURLGetter:bundleURLGetter
125143
andSetter:bundleURLSetter
126144
andDefaultGetter:defaultBundleURLGetter];
@@ -166,6 +184,9 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL
166184

167185
- (void)start
168186
{
187+
if (_bundleURLProvider) {
188+
[self _setBundleURL:_bundleURLProvider()];
189+
}
169190
auto &inspectorFlags = jsinspector_modern::InspectorFlags::getInstance();
170191
if (inspectorFlags.getEnableModernCDPRegistry() && !_inspectorPageId.has_value()) {
171192
_inspectorTarget =
@@ -204,7 +225,8 @@ - (void)start
204225
turboModuleManagerDelegate:_turboModuleManagerDelegate
205226
onInitialBundleLoad:_onInitialBundleLoad
206227
moduleRegistry:_moduleRegistry
207-
parentInspectorTarget:_inspectorTarget.get()];
228+
parentInspectorTarget:_inspectorTarget.get()
229+
launchOptions:_launchOptions];
208230
[_hostDelegate hostDidStart:self];
209231
}
210232

@@ -284,7 +306,8 @@ - (void)didReceiveReloadCommand
284306
turboModuleManagerDelegate:_turboModuleManagerDelegate
285307
onInitialBundleLoad:_onInitialBundleLoad
286308
moduleRegistry:_moduleRegistry
287-
parentInspectorTarget:_inspectorTarget.get()];
309+
parentInspectorTarget:_inspectorTarget.get()
310+
launchOptions:_launchOptions];
288311
[_hostDelegate hostDidStart:self];
289312

290313
for (RCTFabricSurface *surface in [self _getAttachedSurfaces]) {

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ typedef void (^_Null_unspecified RCTInstanceInitialBundleLoadCompletionBlock)();
6262
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
6363
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
6464
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
65-
parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget;
65+
parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget
66+
launchOptions:(nullable NSDictionary *)launchOptions;
6667

6768
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;
6869

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ @implementation RCTInstance {
8383
std::mutex _invalidationMutex;
8484
std::atomic<bool> _valid;
8585
RCTJSThreadManager *_jsThreadManager;
86+
NSDictionary *_launchOptions;
8687

8788
// APIs supporting interop with native modules and view managers
8889
RCTBridgeModuleDecorator *_bridgeModuleDecorator;
@@ -99,6 +100,7 @@ - (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
99100
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
100101
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
101102
parentInspectorTarget:(jsinspector_modern::PageTarget *)parentInspectorTarget
103+
launchOptions:(nullable NSDictionary *)launchOptions
102104
{
103105
if (self = [super init]) {
104106
_performanceLogger = [RCTPerformanceLogger new];
@@ -124,6 +126,7 @@ - (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
124126
[weakSelf callFunctionOnJSModule:moduleName method:methodName args:args];
125127
}];
126128
}
129+
_launchOptions = launchOptions;
127130

128131
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
129132

@@ -270,7 +273,8 @@ - (void)_start
270273
[strongSelf registerSegmentWithId:segmentId path:path];
271274
}
272275
}
273-
runtime:_reactInstance->getJavaScriptContext()];
276+
runtime:_reactInstance->getJavaScriptContext()
277+
launchOptions:_launchOptions];
274278
bridgeProxy.jsCallInvoker = jsCallInvoker;
275279
[RCTBridge setCurrentBridge:(RCTBridge *)bridgeProxy];
276280

0 commit comments

Comments
 (0)