Pass information from request to turbo native

I am playing with turbo-android demo project and I really like this approach. Found how to send information in user agent to detect in server that request is from mobile app, but I don’t found any clue how to pass some information from request to native layer, for example after login and logout I would like turn on/off subscriptions for push notifications, is it possible?

You communicate with the native side via a Bridge (a JS postMessage). There’s probably one in the demo.

That’s how you send messages from web to native.

Yeah, see turbo-android/ at main · hotwired/turbo-android · GitHub

Use addJavascriptInterface to create a function that maps to a native JS interface. Then in your views, call that function if it exists.