iOS Webview now using local RNCWebView
This commit is contained in:
parent
52ba380e4a
commit
bd2c3bc8c2
|
@ -13,9 +13,9 @@
|
|||
* Special scheme used to pass messages to the injectedJavaScript
|
||||
* code without triggering a page load. Usage:
|
||||
*
|
||||
* window.location.href = RCTJSNavigationScheme + '://hello'
|
||||
* window.location.href = RNCJSNavigationScheme + '://hello'
|
||||
*/
|
||||
extern NSString *const RCTJSNavigationScheme;
|
||||
extern NSString *const RNCJSNavigationScheme;
|
||||
|
||||
@protocol RNCWebViewDelegate <NSObject>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#import <React/RCTView.h>
|
||||
#import <React/UIView+React.h>
|
||||
|
||||
NSString *const RCTJSNavigationScheme = @"react-js-navigation";
|
||||
NSString *const RNCJSNavigationScheme = @"react-js-navigation";
|
||||
|
||||
static NSString *const kPostMessageHost = @"postMessage";
|
||||
|
||||
|
@ -201,7 +201,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
|||
- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
|
||||
navigationType:(UIWebViewNavigationType)navigationType
|
||||
{
|
||||
BOOL isJSNavigation = [request.URL.scheme isEqualToString:RCTJSNavigationScheme];
|
||||
BOOL isJSNavigation = [request.URL.scheme isEqualToString:RNCJSNavigationScheme];
|
||||
|
||||
static NSDictionary<NSNumber *, NSString *> *navigationTypes;
|
||||
static dispatch_once_t onceToken;
|
||||
|
@ -329,7 +329,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
|||
"messagePending = false;"
|
||||
"processQueue();"
|
||||
"});"
|
||||
"})();", RCTJSNavigationScheme, kPostMessageHost
|
||||
"})();", RNCJSNavigationScheme, kPostMessageHost
|
||||
];
|
||||
[webView stringByEvaluatingJavaScriptFromString:source];
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ function processDecelerationRate(decelerationRate) {
|
|||
}
|
||||
|
||||
|
||||
// const RNCWebViewManager = NativeModules.WebViewManager;
|
||||
const RNCWebViewManager = NativeModules.WebViewManager;
|
||||
|
||||
const BGWASH = 'rgba(255,255,255,0.8)';
|
||||
const RCT_WEBVIEW_REF = 'webview';
|
||||
|
|
Loading…
Reference in New Issue