@lofter-common-shared/rn-webview-message

0.1.5 • Public • Published

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); }} />

Readme

Keywords

none

Package Sidebar

Install

npm i @lofter-common-shared/rn-webview-message

Weekly Downloads

0

Version

0.1.5

License

MIT

Unpacked Size

30.7 kB

Total Files

19

Last publish

Collaborators

  • luofeiyue
  • whiskeyi
  • yousy
  • guoyeeg
  • azgaga
  • liushichuan
  • yaochen
  • shenyuan
  • aflyermin
  • ignous
  • jeekdong