|
@@ -398,6 +398,11 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
398
|
398
|
public void setMessagingEnabled(WebView view, boolean enabled) {
|
399
|
399
|
((RNCWebView) view).setMessagingEnabled(enabled);
|
400
|
400
|
}
|
|
401
|
+
|
|
402
|
+ @ReactProp(name = "messagingModuleName")
|
|
403
|
+ public void setMessagingModuleName(WebView view, String moduleName) {
|
|
404
|
+ ((RNCWebView) view).setMessagingModuleName(moduleName);
|
|
405
|
+ }
|
401
|
406
|
|
402
|
407
|
@ReactProp(name = "incognito")
|
403
|
408
|
public void setIncognito(WebView view, boolean enabled) {
|
|
@@ -975,6 +980,8 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
975
|
980
|
String injectedJS;
|
976
|
981
|
protected boolean messagingEnabled = false;
|
977
|
982
|
protected @Nullable
|
|
983
|
+ String messagingModuleName;
|
|
984
|
+ protected @Nullable
|
978
|
985
|
RNCWebViewClient mRNCWebViewClient;
|
979
|
986
|
protected @Nullable
|
980
|
987
|
CatalystInstance mCatalystInstance;
|
|
@@ -1076,6 +1083,10 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
1076
|
1083
|
}
|
1077
|
1084
|
}
|
1078
|
1085
|
|
|
1086
|
+ public void setMessagingModuleName(String moduleName) {
|
|
1087
|
+ messagingModuleName = moduleName;
|
|
1088
|
+ }
|
|
1089
|
+
|
1079
|
1090
|
protected void evaluateJavascriptWithFallback(String script) {
|
1080
|
1091
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
1081
|
1092
|
evaluateJavascript(script, null);
|
|
@@ -1139,7 +1150,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
1139
|
1150
|
WritableNativeArray params = new WritableNativeArray();
|
1140
|
1151
|
params.pushMap(event);
|
1141
|
1152
|
|
1142
|
|
- mCatalystInstance.callFunction("WebViewMessageHandler", "onMessage", params);
|
|
1153
|
+ mCatalystInstance.callFunction(messagingModuleName, "onMessage", params);
|
1143
|
1154
|
}
|
1144
|
1155
|
|
1145
|
1156
|
protected void onScrollChanged(int x, int y, int oldX, int oldY) {
|