thj-webview-js-bridge
v1.0.1
Published
An ios/android bridge for sending messages between Obj-C and Javascript in webviews.
Downloads
3
Readme
WebviewJavascriptBridge
Usage
npm install
Javascript API
Register a handler called call
return with Promise
Example:
call("forward", {type: 1}, function(data) { console.log(data); })
or call global object Example:
WebviewJsBridge.jsCallNative("forward", {type: 1}, function(data) { console.log(data); })
WebviewJsBridge.listenToNativeEmitMessage("networkStateChange", function(data) { console.log('network type: ' + data.networkType); })