rn上的webview 基于 react-native-webview
RN -> webview
const run = try { window.lofterMessage(" { "key": "xx", "data": {} } ") } catch(e){}
;
this.webref.injectJavaScript(run); webview -> RN // webview window.ReactNativeWebView.postMessage("{ "key": "xx", "data": {} }")
// RN <WebView source={{ html }} onMessage={(event) => { JSON.parse(event.nativeEvent.data); }} />