Kaynağa Gözat

auto commit

app
jfinn 3 yıl önce
ebeveyn
işleme
a73b5d864a
1 değiştirilmiş dosya ile 16 ekleme ve 6 silme
  1. 16
    6
      mdev/wv0.native.js

+ 16
- 6
mdev/wv0.native.js Dosyayı Görüntüle

@@ -21,15 +21,12 @@ import { Header, LoadingIndicator, Text } from '../react/features/base/react';
21 21
 
22 22
 
23 23
 
24
-class JSBridge(){
25
-    @JavascriptInterface
26
-    fun showMessageInNative(message:String){
27
-        //Received message from webview in native, process data
28
-    }
29
-}
30 24
 
31 25
 
32 26
 
27
+function onMsg(event ){
28
+    var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
29
+}
33 30
 
34 31
 
35 32
 type Props = {}
@@ -76,6 +73,12 @@ class Wview_v1 extends PureComponent<Props> {
76 73
             // style = {wv0_styles.v1 || {}}
77 74
             // >
78 75
             var wv0_styles_dev = this.wv0_styles_dev || {}
76
+
77
+
78
+            var injectedJs = `
79
+  window.postMessage("Your message");
80
+`;
81
+
79 82
              // <View style = { wv0_styles.v1 || {} }>
80 83
             // style = {webview_style}
81 84
                 
@@ -91,6 +94,13 @@ class Wview_v1 extends PureComponent<Props> {
91 94
 
92 95
             <WebView source = {{uri:wb_url}}
93 96
             style = {wv0_styles_dev.webview_style || {}}
97
+            injectedJavaScript={injectedJs}
98
+
99
+    startInLoadingState
100
+    javaScriptEnabledAndroid={true}
101
+    javaScriptEnabled={true}
102
+
103
+            onMessage={onMsg}
94 104
             ></WebView>
95 105
             <Text2 style = { wv0_styles_dev.txt2 || {} }
96 106
              >

Loading…
İptal
Kaydet