瀏覽代碼

Support changing javascript bundle location in runtime (#5247)

Yogev Ben David 5 年之前
父節點
當前提交
8959d680d8
No account linked to committer's email address
共有 4 個檔案被更改,包括 12 行新增0 行删除
  1. 2
    0
      lib/ios/RNNBridgeManager.h
  2. 4
    0
      lib/ios/RNNBridgeManager.m
  3. 2
    0
      lib/ios/ReactNativeNavigation.h
  4. 4
    0
      lib/ios/ReactNativeNavigation.m

+ 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 {