Selaa lähdekoodia

Added RNCWebViewManager to xcode proj

Jamon Holmgren 6 vuotta sitten
vanhempi
commit
52ba380e4a

+ 2
- 2
android/src/main/java/com/infinitered/webview/ReactWebViewManager.java Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.
@@ -93,7 +93,7 @@ import org.json.JSONObject;
93 93
 @ReactModule(name = ReactWebViewManager.REACT_CLASS)
94 94
 public class ReactWebViewManager extends SimpleViewManager<WebView> {
95 95
 
96
-  protected static final String REACT_CLASS = "RCTWebView";
96
+  protected static final String REACT_CLASS = "RNCWebView";
97 97
 
98 98
   protected static final String HTML_ENCODING = "UTF-8";
99 99
   protected static final String HTML_MIME_TYPE = "text/html";

+ 1
- 1
android/src/main/java/com/infinitered/webview/WebViewConfig.java Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
android/src/main/java/com/infinitered/webview/events/TopLoadingErrorEvent.java Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
android/src/main/java/com/infinitered/webview/events/TopLoadingFinishEvent.java Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
android/src/main/java/com/infinitered/webview/events/TopLoadingStartEvent.java Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
android/src/main/java/com/infinitered/webview/events/TopMessageEvent.java Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
examples/WebViewExample.js Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
examples/XHRExampleCookies.js Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 1
- 1
index.js Näytä tiedosto

@@ -1,3 +1,3 @@
1
-import WebView from './src/js/WebView';
1
+import WebView from './js/WebView';
2 2
 
3 3
 export { WebView };

ios/RCTWebView.h → ios/RNCWebView.h Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.
@@ -7,7 +7,7 @@
7 7
 
8 8
 #import <React/RCTView.h>
9 9
 
10
-@class RCTWebView;
10
+@class RNCWebView;
11 11
 
12 12
 /**
13 13
  * Special scheme used to pass messages to the injectedJavaScript
@@ -17,17 +17,17 @@
17 17
  */
18 18
 extern NSString *const RCTJSNavigationScheme;
19 19
 
20
-@protocol RCTWebViewDelegate <NSObject>
20
+@protocol RNCWebViewDelegate <NSObject>
21 21
 
22
-- (BOOL)webView:(RCTWebView *)webView
22
+- (BOOL)webView:(RNCWebView *)webView
23 23
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
24 24
    withCallback:(RCTDirectEventBlock)callback;
25 25
 
26 26
 @end
27 27
 
28
-@interface RCTWebView : RCTView
28
+@interface RNCWebView : RCTView
29 29
 
30
-@property (nonatomic, weak) id<RCTWebViewDelegate> delegate;
30
+@property (nonatomic, weak) id<RNCWebViewDelegate> delegate;
31 31
 
32 32
 @property (nonatomic, copy) NSDictionary *source;
33 33
 @property (nonatomic, assign) UIEdgeInsets contentInset;

ios/RCTWebView.m → ios/RNCWebView.m Näytä tiedosto

@@ -1,27 +1,26 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.
6 6
  */
7 7
 
8
-#import "RCTWebView.h"
8
+#import "RNCWebView.h"
9 9
 
10
-#import <UIKit/UIKit.h>
11
-
12
-#import "RCTAutoInsetsProtocol.h"
13
-#import "RCTConvert.h"
14
-#import "RCTEventDispatcher.h"
15
-#import "RCTLog.h"
16
-#import "RCTUtils.h"
17
-#import "RCTView.h"
18
-#import "UIView+React.h"
10
+// #import <UIKit/UIKit.h>
11
+#import <React/RCTAutoInsetsProtocol.h>
12
+#import <React/RCTConvert.h>
13
+#import <React/RCTEventDispatcher.h>
14
+#import <React/RCTLog.h>
15
+#import <React/RCTUtils.h>
16
+#import <React/RCTView.h>
17
+#import <React/UIView+React.h>
19 18
 
20 19
 NSString *const RCTJSNavigationScheme = @"react-js-navigation";
21 20
 
22 21
 static NSString *const kPostMessageHost = @"postMessage";
23 22
 
24
-@interface RCTWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
23
+@interface RNCWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
25 24
 
26 25
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
27 26
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
@@ -31,7 +30,7 @@ static NSString *const kPostMessageHost = @"postMessage";
31 30
 
32 31
 @end
33 32
 
34
-@implementation RCTWebView
33
+@implementation RNCWebView
35 34
 {
36 35
   UIWebView *_webView;
37 36
   NSString *_injectedJavaScript;

ios/RCTWebView.podspec → ios/RNCWebView.podspec Näytä tiedosto

@@ -1,18 +1,18 @@
1 1
 
2 2
 Pod::Spec.new do |s|
3
-  s.name         = "RCTWebView"
3
+  s.name         = "RNCWebView"
4 4
   s.version      = "1.0.0"
5
-  s.summary      = "RCTWebView"
5
+  s.summary      = "RNCWebView"
6 6
   s.description  = <<-DESC
7
-                  RCTWebView
7
+                  RNCWebView
8 8
                    DESC
9 9
   s.homepage     = ""
10 10
   s.license      = "MIT"
11 11
   # s.license      = { :type => "MIT", :file => "FILE_LICENSE" }
12 12
   s.author             = { "author" => "author@domain.cn" }
13 13
   s.platform     = :ios, "7.0"
14
-  s.source       = { :git => "https://github.com/author/RCTWebView.git", :tag => "master" }
15
-  s.source_files  = "RCTWebView/**/*.{h,m}"
14
+  s.source       = { :git => "https://github.com/author/RNCWebView.git", :tag => "master" }
15
+  s.source_files  = "RNCWebView/**/*.{h,m}"
16 16
   s.requires_arc = true
17 17
 
18 18
 

ios/RCTWebView.xcodeproj/project.pbxproj → ios/RNCWebView.xcodeproj/project.pbxproj Näytä tiedosto

@@ -7,7 +7,8 @@
7 7
 	objects = {
8 8
 
9 9
 /* Begin PBXBuildFile section */
10
-		B3E7B58A1CC2AC0600A0062D /* RCTWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RCTWebView.m */; };
10
+		B3E7B58A1CC2AC0600A0062D /* RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNCWebView.m */; };
11
+		E9C1776D21143306006210F8 /* RNCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C1776B21143306006210F8 /* RNCWebViewManager.m */; };
11 12
 /* End PBXBuildFile section */
12 13
 
13 14
 /* Begin PBXCopyFilesBuildPhase section */
@@ -23,9 +24,11 @@
23 24
 /* End PBXCopyFilesBuildPhase section */
24 25
 
25 26
 /* Begin PBXFileReference section */
26
-		134814201AA4EA6300B7C361 /* libRCTWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
27
-		B3E7B5881CC2AC0600A0062D /* RCTWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebView.h; sourceTree = "<group>"; };
28
-		B3E7B5891CC2AC0600A0062D /* RCTWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebView.m; sourceTree = "<group>"; };
27
+		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
28
+		B3E7B5881CC2AC0600A0062D /* RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWebView.h; sourceTree = "<group>"; };
29
+		B3E7B5891CC2AC0600A0062D /* RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWebView.m; sourceTree = "<group>"; };
30
+		E9C1776B21143306006210F8 /* RNCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWebViewManager.m; sourceTree = "<group>"; };
31
+		E9C1776C21143306006210F8 /* RNCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWebViewManager.h; sourceTree = "<group>"; };
29 32
 /* End PBXFileReference section */
30 33
 
31 34
 /* Begin PBXFrameworksBuildPhase section */
@@ -42,7 +45,7 @@
42 45
 		134814211AA4EA7D00B7C361 /* Products */ = {
43 46
 			isa = PBXGroup;
44 47
 			children = (
45
-				134814201AA4EA6300B7C361 /* libRCTWebView.a */,
48
+				134814201AA4EA6300B7C361 /* libRNCWebView.a */,
46 49
 			);
47 50
 			name = Products;
48 51
 			sourceTree = "<group>";
@@ -50,8 +53,10 @@
50 53
 		58B511D21A9E6C8500147676 = {
51 54
 			isa = PBXGroup;
52 55
 			children = (
53
-				B3E7B5881CC2AC0600A0062D /* RCTWebView.h */,
54
-				B3E7B5891CC2AC0600A0062D /* RCTWebView.m */,
56
+				E9C1776C21143306006210F8 /* RNCWebViewManager.h */,
57
+				E9C1776B21143306006210F8 /* RNCWebViewManager.m */,
58
+				B3E7B5881CC2AC0600A0062D /* RNCWebView.h */,
59
+				B3E7B5891CC2AC0600A0062D /* RNCWebView.m */,
55 60
 				134814211AA4EA7D00B7C361 /* Products */,
56 61
 			);
57 62
 			sourceTree = "<group>";
@@ -59,9 +64,9 @@
59 64
 /* End PBXGroup section */
60 65
 
61 66
 /* Begin PBXNativeTarget section */
62
-		58B511DA1A9E6C8500147676 /* RCTWebView */ = {
67
+		58B511DA1A9E6C8500147676 /* RNCWebView */ = {
63 68
 			isa = PBXNativeTarget;
64
-			buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTWebView" */;
69
+			buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */;
65 70
 			buildPhases = (
66 71
 				58B511D71A9E6C8500147676 /* Sources */,
67 72
 				58B511D81A9E6C8500147676 /* Frameworks */,
@@ -71,9 +76,9 @@
71 76
 			);
72 77
 			dependencies = (
73 78
 			);
74
-			name = RCTWebView;
79
+			name = RNCWebView;
75 80
 			productName = RCTDataManager;
76
-			productReference = 134814201AA4EA6300B7C361 /* libRCTWebView.a */;
81
+			productReference = 134814201AA4EA6300B7C361 /* libRNCWebView.a */;
77 82
 			productType = "com.apple.product-type.library.static";
78 83
 		};
79 84
 /* End PBXNativeTarget section */
@@ -90,7 +95,7 @@
90 95
 					};
91 96
 				};
92 97
 			};
93
-			buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTWebView" */;
98
+			buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */;
94 99
 			compatibilityVersion = "Xcode 3.2";
95 100
 			developmentRegion = English;
96 101
 			hasScannedForEncodings = 0;
@@ -102,7 +107,7 @@
102 107
 			projectDirPath = "";
103 108
 			projectRoot = "";
104 109
 			targets = (
105
-				58B511DA1A9E6C8500147676 /* RCTWebView */,
110
+				58B511DA1A9E6C8500147676 /* RNCWebView */,
106 111
 			);
107 112
 		};
108 113
 /* End PBXProject section */
@@ -112,7 +117,8 @@
112 117
 			isa = PBXSourcesBuildPhase;
113 118
 			buildActionMask = 2147483647;
114 119
 			files = (
115
-				B3E7B58A1CC2AC0600A0062D /* RCTWebView.m in Sources */,
120
+				B3E7B58A1CC2AC0600A0062D /* RNCWebView.m in Sources */,
121
+				E9C1776D21143306006210F8 /* RNCWebViewManager.m in Sources */,
116 122
 			);
117 123
 			runOnlyForDeploymentPostprocessing = 0;
118 124
 		};
@@ -204,14 +210,14 @@
204 210
 			isa = XCBuildConfiguration;
205 211
 			buildSettings = {
206 212
 				HEADER_SEARCH_PATHS = (
207
-				"$(inherited)",
213
+					"$(inherited)",
208 214
 					/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
209 215
 					"$(SRCROOT)/../../../React/**",
210 216
 					"$(SRCROOT)/../../react-native/React/**",
211 217
 				);
212 218
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
213 219
 				OTHER_LDFLAGS = "-ObjC";
214
-				PRODUCT_NAME = RCTWebView;
220
+				PRODUCT_NAME = RNCWebView;
215 221
 				SKIP_INSTALL = YES;
216 222
 			};
217 223
 			name = Debug;
@@ -227,7 +233,7 @@
227 233
 				);
228 234
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
229 235
 				OTHER_LDFLAGS = "-ObjC";
230
-				PRODUCT_NAME = RCTWebView;
236
+				PRODUCT_NAME = RNCWebView;
231 237
 				SKIP_INSTALL = YES;
232 238
 			};
233 239
 			name = Release;
@@ -235,7 +241,7 @@
235 241
 /* End XCBuildConfiguration section */
236 242
 
237 243
 /* Begin XCConfigurationList section */
238
-		58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTWebView" */ = {
244
+		58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */ = {
239 245
 			isa = XCConfigurationList;
240 246
 			buildConfigurations = (
241 247
 				58B511ED1A9E6C8500147676 /* Debug */,
@@ -244,7 +250,7 @@
244 250
 			defaultConfigurationIsVisible = 0;
245 251
 			defaultConfigurationName = Release;
246 252
 		};
247
-		58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTWebView" */ = {
253
+		58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */ = {
248 254
 			isa = XCConfigurationList;
249 255
 			buildConfigurations = (
250 256
 				58B511F01A9E6C8500147676 /* Debug */,

ios/RCTWebView.xcworkspace/contents.xcworkspacedata → ios/RNCWebView.xcworkspace/contents.xcworkspacedata Näytä tiedosto

@@ -3,7 +3,7 @@
3 3
 <Workspace
4 4
    version = "1.0">
5 5
    <FileRef
6
-      location = "group:RCTWebView.xcodeproj">
6
+      location = "group:RNCWebView.xcodeproj">
7 7
    </FileRef>
8 8
 </Workspace>
9 9
   

ios/RCTWebViewManager.h → ios/RNCWebViewManager.h Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.
@@ -7,6 +7,6 @@
7 7
 
8 8
 #import <React/RCTViewManager.h>
9 9
 
10
-@interface RCTWebViewManager : RCTViewManager
10
+@interface RNCWebViewManager : RCTViewManager
11 11
 
12 12
 @end

ios/RCTWebViewManager.m → ios/RNCWebViewManager.m Näytä tiedosto

@@ -1,22 +1,22 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.
6 6
  */
7 7
 
8
-#import "RCTWebViewManager.h"
8
+#import "RNCWebViewManager.h"
9 9
 
10
-#import "RCTBridge.h"
11
-#import "RCTUIManager.h"
12
-#import "RCTWebView.h"
13
-#import "UIView+React.h"
10
+#import <React/RCTBridge.h>
11
+#import <React/RCTUIManager.h>
12
+#import <React/UIView+React.h>
13
+#import "RNCWebView.h"
14 14
 
15
-@interface RCTWebViewManager () <RCTWebViewDelegate>
15
+@interface RNCWebViewManager () <RNCWebViewDelegate>
16 16
 
17 17
 @end
18 18
 
19
-@implementation RCTWebViewManager
19
+@implementation RNCWebViewManager
20 20
 {
21 21
   NSConditionLock *_shouldStartLoadLock;
22 22
   BOOL _shouldStartLoad;
@@ -26,7 +26,7 @@ RCT_EXPORT_MODULE()
26 26
 
27 27
 - (UIView *)view
28 28
 {
29
-  RCTWebView *webView = [RCTWebView new];
29
+  RNCWebView *webView = [RNCWebView new];
30 30
   webView.delegate = self;
31 31
   return webView;
32 32
 }
@@ -51,10 +51,10 @@ RCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, _webView.dataDetectorTypes, UIDataDet
51 51
 
52 52
 RCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)
53 53
 {
54
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {
55
-    RCTWebView *view = viewRegistry[reactTag];
56
-    if (![view isKindOfClass:[RCTWebView class]]) {
57
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
54
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWebView *> *viewRegistry) {
55
+    RNCWebView *view = viewRegistry[reactTag];
56
+    if (![view isKindOfClass:[RNCWebView class]]) {
57
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWebView, got: %@", view);
58 58
     } else {
59 59
       [view goBack];
60 60
     }
@@ -65,8 +65,8 @@ RCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)
65 65
 {
66 66
   [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
67 67
     id view = viewRegistry[reactTag];
68
-    if (![view isKindOfClass:[RCTWebView class]]) {
69
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
68
+    if (![view isKindOfClass:[RNCWebView class]]) {
69
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWebView, got: %@", view);
70 70
     } else {
71 71
       [view goForward];
72 72
     }
@@ -75,10 +75,10 @@ RCT_EXPORT_METHOD(goForward:(nonnull NSNumber *)reactTag)
75 75
 
76 76
 RCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)
77 77
 {
78
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {
79
-    RCTWebView *view = viewRegistry[reactTag];
80
-    if (![view isKindOfClass:[RCTWebView class]]) {
81
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
78
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWebView *> *viewRegistry) {
79
+    RNCWebView *view = viewRegistry[reactTag];
80
+    if (![view isKindOfClass:[RNCWebView class]]) {
81
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWebView, got: %@", view);
82 82
     } else {
83 83
       [view reload];
84 84
     }
@@ -87,10 +87,10 @@ RCT_EXPORT_METHOD(reload:(nonnull NSNumber *)reactTag)
87 87
 
88 88
 RCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)
89 89
 {
90
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {
91
-    RCTWebView *view = viewRegistry[reactTag];
92
-    if (![view isKindOfClass:[RCTWebView class]]) {
93
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
90
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWebView *> *viewRegistry) {
91
+    RNCWebView *view = viewRegistry[reactTag];
92
+    if (![view isKindOfClass:[RNCWebView class]]) {
93
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWebView, got: %@", view);
94 94
     } else {
95 95
       [view stopLoading];
96 96
     }
@@ -99,10 +99,10 @@ RCT_EXPORT_METHOD(stopLoading:(nonnull NSNumber *)reactTag)
99 99
 
100 100
 RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)
101 101
 {
102
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {
103
-    RCTWebView *view = viewRegistry[reactTag];
104
-    if (![view isKindOfClass:[RCTWebView class]]) {
105
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
102
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWebView *> *viewRegistry) {
103
+    RNCWebView *view = viewRegistry[reactTag];
104
+    if (![view isKindOfClass:[RNCWebView class]]) {
105
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWebView, got: %@", view);
106 106
     } else {
107 107
       [view postMessage:message];
108 108
     }
@@ -111,10 +111,10 @@ RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)m
111 111
 
112 112
 RCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString *)script)
113 113
 {
114
-  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) {
115
-    RCTWebView *view = viewRegistry[reactTag];
116
-    if (![view isKindOfClass:[RCTWebView class]]) {
117
-      RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view);
114
+  [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RNCWebView *> *viewRegistry) {
115
+    RNCWebView *view = viewRegistry[reactTag];
116
+    if (![view isKindOfClass:[RNCWebView class]]) {
117
+      RCTLogError(@"Invalid view returned from registry, expecting RNCWebView, got: %@", view);
118 118
     } else {
119 119
       [view injectJavaScript:script];
120 120
     }
@@ -123,7 +123,7 @@ RCT_EXPORT_METHOD(injectJavaScript:(nonnull NSNumber *)reactTag script:(NSString
123 123
 
124 124
 #pragma mark - Exported synchronous methods
125 125
 
126
-- (BOOL)webView:(__unused RCTWebView *)webView
126
+- (BOOL)webView:(__unused RNCWebView *)webView
127 127
 shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
128 128
    withCallback:(RCTDirectEventBlock)callback
129 129
 {

+ 9
- 9
js/WebView.android.js Näytä tiedosto

@@ -272,7 +272,7 @@ class WebView extends React.Component {
272 272
         );
273 273
     } else if (this.state.viewState !== WebViewState.IDLE) {
274 274
       console.error(
275
-        'RCTWebView invalid state encountered: ' + this.state.loading,
275
+        'RNCWebView invalid state encountered: ' + this.state.loading,
276 276
       );
277 277
     }
278 278
 
@@ -306,7 +306,7 @@ class WebView extends React.Component {
306 306
       WebViewShared.originWhitelistToRegex,
307 307
     );
308 308
 
309
-    let NativeWebView = nativeConfig.component || RCTWebView;
309
+    let NativeWebView = nativeConfig.component || RNCWebView;
310 310
 
311 311
     const webView = (
312 312
       <NativeWebView
@@ -357,7 +357,7 @@ class WebView extends React.Component {
357 357
   goForward = () => {
358 358
     UIManager.dispatchViewManagerCommand(
359 359
       this.getWebViewHandle(),
360
-      UIManager.RCTWebView.Commands.goForward,
360
+      UIManager.RNCWebView.Commands.goForward,
361 361
       null,
362 362
     );
363 363
   };
@@ -365,7 +365,7 @@ class WebView extends React.Component {
365 365
   goBack = () => {
366 366
     UIManager.dispatchViewManagerCommand(
367 367
       this.getWebViewHandle(),
368
-      UIManager.RCTWebView.Commands.goBack,
368
+      UIManager.RNCWebView.Commands.goBack,
369 369
       null,
370 370
     );
371 371
   };
@@ -376,7 +376,7 @@ class WebView extends React.Component {
376 376
     });
377 377
     UIManager.dispatchViewManagerCommand(
378 378
       this.getWebViewHandle(),
379
-      UIManager.RCTWebView.Commands.reload,
379
+      UIManager.RNCWebView.Commands.reload,
380 380
       null,
381 381
     );
382 382
   };
@@ -384,7 +384,7 @@ class WebView extends React.Component {
384 384
   stopLoading = () => {
385 385
     UIManager.dispatchViewManagerCommand(
386 386
       this.getWebViewHandle(),
387
-      UIManager.RCTWebView.Commands.stopLoading,
387
+      UIManager.RNCWebView.Commands.stopLoading,
388 388
       null,
389 389
     );
390 390
   };
@@ -392,7 +392,7 @@ class WebView extends React.Component {
392 392
   postMessage = data => {
393 393
     UIManager.dispatchViewManagerCommand(
394 394
       this.getWebViewHandle(),
395
-      UIManager.RCTWebView.Commands.postMessage,
395
+      UIManager.RNCWebView.Commands.postMessage,
396 396
       [String(data)],
397 397
     );
398 398
   };
@@ -406,7 +406,7 @@ class WebView extends React.Component {
406 406
   injectJavaScript = data => {
407 407
     UIManager.dispatchViewManagerCommand(
408 408
       this.getWebViewHandle(),
409
-      UIManager.RCTWebView.Commands.injectJavaScript,
409
+      UIManager.RNCWebView.Commands.injectJavaScript,
410 410
       [data],
411 411
     );
412 412
   };
@@ -460,7 +460,7 @@ class WebView extends React.Component {
460 460
   };
461 461
 }
462 462
 
463
-const RCTWebView = requireNativeComponent('RCTWebView');
463
+const RNCWebView = requireNativeComponent('RNCWebView');
464 464
 
465 465
 const styles = StyleSheet.create({
466 466
   container: {

+ 1
- 1
js/WebView.integration.js Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
2
+ * Copyright (c) 2018-present, Infinite Red, Inc.
3 3
  *
4 4
  * This source code is licensed under the MIT license found in the
5 5
  * LICENSE file in the root directory of this source tree.

+ 11
- 11
js/WebView.ios.js Näytä tiedosto

@@ -49,7 +49,7 @@ function processDecelerationRate(decelerationRate) {
49 49
 }
50 50
 
51 51
 
52
-const RCTWebViewManager = 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';
@@ -436,7 +436,7 @@ class WebView extends React.Component {
436 436
       );
437 437
     } else if (this.state.viewState !== WebViewState.IDLE) {
438 438
       console.error(
439
-        'RCTWebView invalid state encountered: ' + this.state.loading,
439
+        'RNCWebView invalid state encountered: ' + this.state.loading,
440 440
       );
441 441
     }
442 442
 
@@ -451,7 +451,7 @@ class WebView extends React.Component {
451 451
 
452 452
     const nativeConfig = this.props.nativeConfig || {};
453 453
 
454
-    const viewManager = nativeConfig.viewManager || RCTWebViewManager;
454
+    const viewManager = nativeConfig.viewManager || RNCWebViewManager;
455 455
 
456 456
     const compiledWhitelist = (this.props.originWhitelist || []).map(
457 457
       WebViewShared.originWhitelistToRegex,
@@ -491,7 +491,7 @@ class WebView extends React.Component {
491 491
 
492 492
     const messagingEnabled = typeof this.props.onMessage === 'function';
493 493
 
494
-    const NativeWebView = nativeConfig.component || RCTWebView;
494
+    const NativeWebView = nativeConfig.component || RNCWebView;
495 495
 
496 496
     const webView = (
497 497
       <NativeWebView
@@ -537,7 +537,7 @@ class WebView extends React.Component {
537 537
   goForward = () => {
538 538
     UIManager.dispatchViewManagerCommand(
539 539
       this.getWebViewHandle(),
540
-      UIManager.RCTWebView.Commands.goForward,
540
+      UIManager.RNCWebView.Commands.goForward,
541 541
       null,
542 542
     );
543 543
   };
@@ -548,7 +548,7 @@ class WebView extends React.Component {
548 548
   goBack = () => {
549 549
     UIManager.dispatchViewManagerCommand(
550 550
       this.getWebViewHandle(),
551
-      UIManager.RCTWebView.Commands.goBack,
551
+      UIManager.RNCWebView.Commands.goBack,
552 552
       null,
553 553
     );
554 554
   };
@@ -560,7 +560,7 @@ class WebView extends React.Component {
560 560
     this.setState({ viewState: WebViewState.LOADING });
561 561
     UIManager.dispatchViewManagerCommand(
562 562
       this.getWebViewHandle(),
563
-      UIManager.RCTWebView.Commands.reload,
563
+      UIManager.RNCWebView.Commands.reload,
564 564
       null,
565 565
     );
566 566
   };
@@ -571,7 +571,7 @@ class WebView extends React.Component {
571 571
   stopLoading = () => {
572 572
     UIManager.dispatchViewManagerCommand(
573 573
       this.getWebViewHandle(),
574
-      UIManager.RCTWebView.Commands.stopLoading,
574
+      UIManager.RNCWebView.Commands.stopLoading,
575 575
       null,
576 576
     );
577 577
   };
@@ -589,7 +589,7 @@ class WebView extends React.Component {
589 589
   postMessage = data => {
590 590
     UIManager.dispatchViewManagerCommand(
591 591
       this.getWebViewHandle(),
592
-      UIManager.RCTWebView.Commands.postMessage,
592
+      UIManager.RNCWebView.Commands.postMessage,
593 593
       [String(data)],
594 594
     );
595 595
   };
@@ -603,7 +603,7 @@ class WebView extends React.Component {
603 603
   injectJavaScript = data => {
604 604
     UIManager.dispatchViewManagerCommand(
605 605
       this.getWebViewHandle(),
606
-      UIManager.RCTWebView.Commands.injectJavaScript,
606
+      UIManager.RNCWebView.Commands.injectJavaScript,
607 607
       [data],
608 608
     );
609 609
   };
@@ -660,7 +660,7 @@ class WebView extends React.Component {
660 660
   };
661 661
 }
662 662
 
663
-const RCTWebView = requireNativeComponent('RCTWebView');
663
+const RNCWebView = requireNativeComponent('RNCWebView');
664 664
 
665 665
 const styles = StyleSheet.create({
666 666
   container: {

+ 2
- 2
package.json Näytä tiedosto

@@ -1,9 +1,9 @@
1 1
 {
2
-  "name": "react-native-webview",
2
+  "name": "ir-webview",
3 3
   "description": "React Native WebView component for iOS + Android",
4 4
   "main": "index.js",
5 5
   "authors": [
6
-    "Jamon Holmgren <jamonholmgren@gmail.com>"
6
+    "Jamon Holmgren <jamon@infinite.red>"
7 7
   ],
8 8
   "version": "0.0.1",
9 9
   "peerDependencies": {