Explorar el Código

fix(PostMessage): Renamed ReactNativeWebview to ReactNativeWebView

fixes #304
Thibault Malbranche hace 5 años
padre
commit
d5fc028383

+ 3
- 3
android/build.gradle Ver fichero

@@ -1,6 +1,6 @@
1 1
 buildscript {
2 2
   //Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
-  def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeWebview_kotlinVersion']
3
+  def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeWebView_kotlinVersion']
4 4
 
5 5
   repositories {
6 6
     google()
@@ -15,11 +15,11 @@ buildscript {
15 15
 }
16 16
 
17 17
 def getExtOrDefault(name) {
18
-  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebview_' + name]
18
+  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
19 19
 }
20 20
 
21 21
 def getExtOrIntegerDefault(name) {
22
-  return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeWebview_' + name]).toInteger()
22
+  return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeWebView_' + name]).toInteger()
23 23
 }
24 24
 
25 25
 apply plugin: 'com.android.library'

+ 5
- 5
android/gradle.properties Ver fichero

@@ -1,5 +1,5 @@
1
-ReactNativeWebview_kotlinVersion=1.3.11
2
-ReactNativeWebview_compileSdkVersion=28
3
-ReactNativeWebview_buildToolsVersion=28.0.3
4
-ReactNativeWebview_targetSdkVersion=28
5
-ReactNativeWebview_supportLibVersion=28.0.0
1
+ReactNativeWebView_kotlinVersion=1.3.11
2
+ReactNativeWebView_compileSdkVersion=28
3
+ReactNativeWebView_buildToolsVersion=28.0.3
4
+ReactNativeWebView_targetSdkVersion=28
5
+ReactNativeWebView_supportLibVersion=28.0.0

+ 1
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java Ver fichero

@@ -109,7 +109,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
109 109
 
110 110
   protected static final String HTML_ENCODING = "UTF-8";
111 111
   protected static final String HTML_MIME_TYPE = "text/html";
112
-  protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebview";
112
+  protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebView";
113 113
 
114 114
   protected static final String HTTP_METHOD_POST = "POST";
115 115
 

+ 2
- 2
docs/Reference.md Ver fichero

@@ -194,9 +194,9 @@ Function that is invoked when the `WebView` is loading.
194 194
 
195 195
 ### `onMessage`
196 196
 
197
-Function that is invoked when the webview calls `window.ReactNativeWebview.postMessage`. Setting this property will inject this global into your webview.
197
+Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`. Setting this property will inject this global into your webview.
198 198
 
199
-`window.ReactNativeWebview.postMessage` accepts one argument, `data`, which will be available on the event object, `event.nativeEvent.data`. `data` must be a string.
199
+`window.ReactNativeWebView.postMessage` accepts one argument, `data`, which will be available on the event object, `event.nativeEvent.data`. `data` must be a string.
200 200
 
201 201
 | Type     | Required |
202 202
 | -------- | -------- |

+ 1
- 1
ios/RNCUIWebView.m Ver fichero

@@ -11,7 +11,7 @@
11 11
 
12 12
 NSString *const RNCJSNavigationScheme = @"react-js-navigation";
13 13
 
14
-static NSString *const MessageHandlerName = @"ReactNativeWebview";
14
+static NSString *const MessageHandlerName = @"ReactNativeWebView";
15 15
 
16 16
 @interface RNCUIWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
17 17
 

+ 1
- 1
ios/RNCWKWebView.m Ver fichero

@@ -13,7 +13,7 @@
13 13
 
14 14
 #import "objc/runtime.h"
15 15
 
16
-static NSString *const MessageHandlerName = @"ReactNativeWebview";
16
+static NSString *const MessageHandlerName = @"ReactNativeWebView";
17 17
 
18 18
 // runtime trick to remove WKWebView keyboard default toolbar
19 19
 // see: http://stackoverflow.com/questions/19033292/ios-7-uiwebview-keyboard-issue/19042279#19042279

+ 2
- 2
js/WebViewTypes.js Ver fichero

@@ -424,10 +424,10 @@ export type WebViewSharedProps = $ReadOnly<{|
424 424
   onNavigationStateChange?: (event: WebViewNavigation) => mixed,
425 425
 
426 426
   /**
427
-   * Function that is invoked when the webview calls `window.ReactNativeWebview.postMessage`.
427
+   * Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`.
428 428
    * Setting this property will inject this global into your webview.
429 429
    *
430
-   * `window.ReactNativeWebview.postMessage` accepts one argument, `data`, which will be
430
+   * `window.ReactNativeWebView.postMessage` accepts one argument, `data`, which will be
431 431
    * available on the event object, `event.nativeEvent.data`. `data` must be a string.
432 432
    */
433 433
   onMessage?: (event: WebViewMessageEvent) => mixed,