webviewbridgeclient
v1.0.1
Published
Client-side component of WebViewJavascriptBridge for sending messages between native code and WebViews on iOS
Downloads
3
Maintainers
Readme
WebViewBridgeClient
Client-side component of WebViewJavascriptBridge for sending messages between native code and WebViews on iOS.
Usage
npm install --save webviewbridgeclient
See complete example WebViewJavascriptBridge
import getBridge from 'webviewbridgeclient'
getBridge().then(bridge => {
bridge.registerHandler('JS Echo', (data, responseCallback) => {
console.log("JS Echo called with:", data)
responseCallback(data)
})
bridge.callHandler('ObjC Echo', {'key': 'value'}).then(responseData => {
console.log("JS received response:", responseData)
})
})
Credits
Basic client side bridge code from WebViewJavascriptBridge