Преглед изворни кода

Support changing javascript bundle location in runtime (#5247)

Yogev Ben David пре 5 година
родитељ
комит
8959d680d8
No account linked to committer's email address

+ 2
- 0
lib/ios/RNNBridgeManager.h Прегледај датотеку

@@ -12,4 +12,6 @@ typedef UIViewController * (^RNNExternalViewCreator)(NSDictionary* props, RCTBri
12 12
 
13 13
 @property (readonly, nonatomic, strong) RCTBridge *bridge;
14 14
 
15
+- (void)setJSCodeLocation:(NSURL *)jsCodeLocation;
16
+
15 17
 @end

+ 4
- 0
lib/ios/RNNBridgeManager.m Прегледај датотеку

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

+ 2
- 0
lib/ios/ReactNativeNavigation.h Прегледај датотеку

@@ -16,6 +16,8 @@ typedef UIViewController * (^RNNExternalViewCreator)(NSDictionary* props, RCTBri
16 16
 
17 17
 + (UIViewController *)findViewController:(NSString *)componentId;
18 18
 
19
++ (void)setJSCodeLocation:(NSURL *)jsCodeLocation;
20
+
19 21
 + (RCTBridge *)getBridge;
20 22
 
21 23
 @end

+ 4
- 0
lib/ios/ReactNativeNavigation.m Прегледај датотеку

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