@lofter-common-shared/rn-webview-message
v0.1.5
Published
rn上的webview 基于 react-native-webview
Downloads
143
Keywords
Readme
rn和webview基础协议
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); }} />