This page only listens for REAL native events coming from Android/iOS.
No mock events. No simulation. No fake callbacks.
Make sure:
nativeEventsBridge.enable = true
- required events are enabled in appConfig
- this page is loaded inside WebToNative app
β οΈ SDK note: this page now loads
native_share_webtonative_min_a8260c1cb4.js. That build's
WTN.on /
WTN.off only accept the classic
positional form β
WTN.on("eventName", callback).
Calling it with an object like
{ events: "...", callback: fn }
throws an error on this SDK, so every listener on this page below has been
written using the positional form to match it.
How to Listen for an Event (Code Example)
// This SDK build only supports the positional form:
window.WTN.on("volume", function (event) {
// event.type = "volume"
// event.data = { direction: 'up' | 'down' }
console.log(event);
});
// To stop listening, pass the SAME function reference to off():
window.WTN.off("volume", myCallback);