Calling android shell app native function from trusted web activity(PWA)

441 views Asked by At

I am trying to call android shell app native function from a trusted web activity in a PWA.

I know that we can do this for webviews using @JavascriptInterface notation, but couldn't find any information if same can be done for trusted web activity as well.

Is it possible to do this?

1

There are 1 answers

0
andreban On

Trusted Web Activities currently don't have an API that is analog to WebView's addJavaScriptInterface(). It's only possible to pass parameters when starting the activity, via query parameters or custom headers. I do recommend filing an issue at https://crbug.com/ describing the use-case you'd like to use this API for, so the team can investigate providing an API for that.