Browse Source

iOS Webview now using local RNCWebView

Jamon Holmgren 6 years ago
parent
commit
bd2c3bc8c2
3 changed files with 6 additions and 6 deletions
  1. 2
    2
      ios/RNCWebView.h
  2. 3
    3
      ios/RNCWebView.m
  3. 1
    1
      js/WebView.ios.js

+ 2
- 2
ios/RNCWebView.h View File

@@ -13,9 +13,9 @@
13 13
  * Special scheme used to pass messages to the injectedJavaScript
14 14
  * code without triggering a page load. Usage:
15 15
  *
16
- *   window.location.href = RCTJSNavigationScheme + '://hello'
16
+ *   window.location.href = RNCJSNavigationScheme + '://hello'
17 17
  */
18
-extern NSString *const RCTJSNavigationScheme;
18
+extern NSString *const RNCJSNavigationScheme;
19 19
 
20 20
 @protocol RNCWebViewDelegate <NSObject>
21 21
 

+ 3
- 3
ios/RNCWebView.m View File

@@ -16,7 +16,7 @@
16 16
 #import <React/RCTView.h>
17 17
 #import <React/UIView+React.h>
18 18
 
19
-NSString *const RCTJSNavigationScheme = @"react-js-navigation";
19
+NSString *const RNCJSNavigationScheme = @"react-js-navigation";
20 20
 
21 21
 static NSString *const kPostMessageHost = @"postMessage";
22 22
 
@@ -201,7 +201,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
201 201
 - (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
202 202
  navigationType:(UIWebViewNavigationType)navigationType
203 203
 {
204
-  BOOL isJSNavigation = [request.URL.scheme isEqualToString:RCTJSNavigationScheme];
204
+  BOOL isJSNavigation = [request.URL.scheme isEqualToString:RNCJSNavigationScheme];
205 205
 
206 206
   static NSDictionary<NSNumber *, NSString *> *navigationTypes;
207 207
   static dispatch_once_t onceToken;
@@ -329,7 +329,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
329 329
           "messagePending = false;"
330 330
           "processQueue();"
331 331
         "});"
332
-      "})();", RCTJSNavigationScheme, kPostMessageHost
332
+      "})();", RNCJSNavigationScheme, kPostMessageHost
333 333
     ];
334 334
     [webView stringByEvaluatingJavaScriptFromString:source];
335 335
   }

+ 1
- 1
js/WebView.ios.js View File

@@ -49,7 +49,7 @@ function processDecelerationRate(decelerationRate) {
49 49
 }
50 50
 
51 51
 
52
-// const RNCWebViewManager = NativeModules.WebViewManager;
52
+const RNCWebViewManager = NativeModules.WebViewManager;
53 53
 
54 54
 const BGWASH = 'rgba(255,255,255,0.8)';
55 55
 const RCT_WEBVIEW_REF = 'webview';