Starting with Chrome 115, TWAs can utilize postMessage to communicate between the web and native app at runtime.
postMessage
See the official docs here: https://developer.chrome.com/docs/android/post-message-twa