Hybrid JS-SDK
yarn
yarn build
cd examples
yarn
yarn start
Native inject global function into browser:
Web define two methods to window:
event
to native
hybrid.dispatch(event, params).then(console.log);
event
const unsubscribe1 = hybrid.listen(event, callback);
const unsubscribe2 = hybrid.listen(event, callback);
event
unsubscribe1()
event
to web
webApp.dispatch(event, params);
event
setTimeout(() => {
webApp.callBack(eventId, params);
});