I'm having a web server by Next JS (BE by Spring), and iOS, Android App. I'm handling change page in Web, and i want Native apps to detect this for handle some logic in apps. I tried to use window.webkit.messageHandlers but it return Cannot read properties of undefined (reading "messageHandlers").
How can i solve this, or any other solutions ?
Here's my code:
if (data == 200) {
window.webkit.messageHandlers.testApp.postMessage.bind("OK");
}