mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 19:51:10 +00:00
fix(PostMessage): Renamed ReactNativeWebview to ReactNativeWebView
fixes #304
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
buildscript {
|
||||
//Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
||||
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeWebview_kotlinVersion']
|
||||
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeWebView_kotlinVersion']
|
||||
|
||||
repositories {
|
||||
google()
|
||||
@@ -15,11 +15,11 @@ buildscript {
|
||||
}
|
||||
|
||||
def getExtOrDefault(name) {
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebview_' + name]
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
|
||||
}
|
||||
|
||||
def getExtOrIntegerDefault(name) {
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeWebview_' + name]).toInteger()
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeWebView_' + name]).toInteger()
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
ReactNativeWebview_kotlinVersion=1.3.11
|
||||
ReactNativeWebview_compileSdkVersion=28
|
||||
ReactNativeWebview_buildToolsVersion=28.0.3
|
||||
ReactNativeWebview_targetSdkVersion=28
|
||||
ReactNativeWebview_supportLibVersion=28.0.0
|
||||
ReactNativeWebView_kotlinVersion=1.3.11
|
||||
ReactNativeWebView_compileSdkVersion=28
|
||||
ReactNativeWebView_buildToolsVersion=28.0.3
|
||||
ReactNativeWebView_targetSdkVersion=28
|
||||
ReactNativeWebView_supportLibVersion=28.0.0
|
||||
@@ -109,7 +109,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
||||
|
||||
protected static final String HTML_ENCODING = "UTF-8";
|
||||
protected static final String HTML_MIME_TYPE = "text/html";
|
||||
protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebview";
|
||||
protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebView";
|
||||
|
||||
protected static final String HTTP_METHOD_POST = "POST";
|
||||
|
||||
|
||||
+2
-2
@@ -194,9 +194,9 @@ Function that is invoked when the `WebView` is loading.
|
||||
|
||||
### `onMessage`
|
||||
|
||||
Function that is invoked when the webview calls `window.ReactNativeWebview.postMessage`. Setting this property will inject this global into your webview.
|
||||
Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`. Setting this property will inject this global into your webview.
|
||||
|
||||
`window.ReactNativeWebview.postMessage` accepts one argument, `data`, which will be available on the event object, `event.nativeEvent.data`. `data` must be a string.
|
||||
`window.ReactNativeWebView.postMessage` accepts one argument, `data`, which will be available on the event object, `event.nativeEvent.data`. `data` must be a string.
|
||||
|
||||
| Type | Required |
|
||||
| -------- | -------- |
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
NSString *const RNCJSNavigationScheme = @"react-js-navigation";
|
||||
|
||||
static NSString *const MessageHandlerName = @"ReactNativeWebview";
|
||||
static NSString *const MessageHandlerName = @"ReactNativeWebView";
|
||||
|
||||
@interface RNCUIWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
|
||||
#import "objc/runtime.h"
|
||||
|
||||
static NSString *const MessageHandlerName = @"ReactNativeWebview";
|
||||
static NSString *const MessageHandlerName = @"ReactNativeWebView";
|
||||
|
||||
// runtime trick to remove WKWebView keyboard default toolbar
|
||||
// see: http://stackoverflow.com/questions/19033292/ios-7-uiwebview-keyboard-issue/19042279#19042279
|
||||
|
||||
+2
-2
@@ -424,10 +424,10 @@ export type WebViewSharedProps = $ReadOnly<{|
|
||||
onNavigationStateChange?: (event: WebViewNavigation) => mixed,
|
||||
|
||||
/**
|
||||
* Function that is invoked when the webview calls `window.ReactNativeWebview.postMessage`.
|
||||
* Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`.
|
||||
* Setting this property will inject this global into your webview.
|
||||
*
|
||||
* `window.ReactNativeWebview.postMessage` accepts one argument, `data`, which will be
|
||||
* `window.ReactNativeWebView.postMessage` accepts one argument, `data`, which will be
|
||||
* available on the event object, `event.nativeEvent.data`. `data` must be a string.
|
||||
*/
|
||||
onMessage?: (event: WebViewMessageEvent) => mixed,
|
||||
|
||||
Reference in New Issue
Block a user