Browse Source

Support changing javascript bundle location in runtime (#5247)

Yogev Ben David 5 years ago
parent
commit
8959d680d8
No account linked to committer's email address

+ 2
- 0
lib/ios/RNNBridgeManager.h View File

12
 
12
 
13
 @property (readonly, nonatomic, strong) RCTBridge *bridge;
13
 @property (readonly, nonatomic, strong) RCTBridge *bridge;
14
 
14
 
15
+- (void)setJSCodeLocation:(NSURL *)jsCodeLocation;
16
+
15
 @end
17
 @end

+ 4
- 0
lib/ios/RNNBridgeManager.m View File

57
 	return self;
57
 	return self;
58
 }
58
 }
59
 
59
 
60
+- (void)setJSCodeLocation:(NSURL *)jsCodeLocation {
61
+	_jsCodeLocation = jsCodeLocation;
62
+}
63
+
60
 - (void)registerExternalComponent:(NSString *)name callback:(RNNExternalViewCreator)callback {
64
 - (void)registerExternalComponent:(NSString *)name callback:(RNNExternalViewCreator)callback {
61
 	[_store registerExternalComponent:name callback:callback];
65
 	[_store registerExternalComponent:name callback:callback];
62
 }
66
 }

+ 2
- 0
lib/ios/ReactNativeNavigation.h View File

16
 
16
 
17
 + (UIViewController *)findViewController:(NSString *)componentId;
17
 + (UIViewController *)findViewController:(NSString *)componentId;
18
 
18
 
19
++ (void)setJSCodeLocation:(NSURL *)jsCodeLocation;
20
+
19
 + (RCTBridge *)getBridge;
21
 + (RCTBridge *)getBridge;
20
 
22
 
21
 @end
23
 @end

+ 4
- 0
lib/ios/ReactNativeNavigation.m View File

36
     return [RNNLayoutManager findComponentForId:componentId];
36
     return [RNNLayoutManager findComponentForId:componentId];
37
 }
37
 }
38
 
38
 
39
++ (void)setJSCodeLocation:(NSURL *)jsCodeLocation {
40
+	[[ReactNativeNavigation sharedInstance].bridgeManager setJSCodeLocation:jsCodeLocation];
41
+}
42
+
39
 # pragma mark - instance
43
 # pragma mark - instance
40
 
44
 
41
 + (instancetype) sharedInstance {
45
 + (instancetype) sharedInstance {