Browse Source

fix(PostMessage): Renamed ReactNativeWebview to ReactNativeWebView

fixes #304
Thibault Malbranche 5 years ago
parent
commit
d5fc028383

+ 3
- 3
android/build.gradle View File

1
 buildscript {
1
 buildscript {
2
   //Buildscript is evaluated before everything else so we can't use getExtOrDefault
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
   repositories {
5
   repositories {
6
     google()
6
     google()
15
 }
15
 }
16
 
16
 
17
 def getExtOrDefault(name) {
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
 def getExtOrIntegerDefault(name) {
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
 apply plugin: 'com.android.library'
25
 apply plugin: 'com.android.library'

+ 5
- 5
android/gradle.properties View File

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 View File

109
 
109
 
110
   protected static final String HTML_ENCODING = "UTF-8";
110
   protected static final String HTML_ENCODING = "UTF-8";
111
   protected static final String HTML_MIME_TYPE = "text/html";
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
   protected static final String HTTP_METHOD_POST = "POST";
114
   protected static final String HTTP_METHOD_POST = "POST";
115
 
115
 

+ 2
- 2
docs/Reference.md View File

194
 
194
 
195
 ### `onMessage`
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
 | Type     | Required |
201
 | Type     | Required |
202
 | -------- | -------- |
202
 | -------- | -------- |

+ 1
- 1
ios/RNCUIWebView.m View File

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

+ 1
- 1
ios/RNCWKWebView.m View File

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

+ 2
- 2
js/WebViewTypes.js View File

424
   onNavigationStateChange?: (event: WebViewNavigation) => mixed,
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
    * Setting this property will inject this global into your webview.
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
    * available on the event object, `event.nativeEvent.data`. `data` must be a string.
431
    * available on the event object, `event.nativeEvent.data`. `data` must be a string.
432
    */
432
    */
433
   onMessage?: (event: WebViewMessageEvent) => mixed,
433
   onMessage?: (event: WebViewMessageEvent) => mixed,