I can’t quite understand the main purpose of TrustedWebActivityService
in Android TWA. The documentation says: At present it only serves requests to do with notifications
.
I can’t figure out what requests and what notifications. It receives NotificationManager
, has different methods to work with notifications: notify
, cancel
, etc.
I have my own PWA (with Digital Asset Links) that implements WEB notifications. When the TWA app with this PWA is NOT INSTALLED, I receive notifications from this PWA from Chrome. When I install the TWA with this PWA, I can’t receive notifications from either the TWA app or Chrome.
I thought TrustedWebActivityService
is responsible for intercepting WEB Pushes from PWA and displaying them in a native way using Android notification API, because there are too many things that make it think that way (NotificationManager
and methods inside). But it doesn’t do anything.
Finally, my questions:
- What is the main purpose of
TrustedWebActivityService
? Could you give some real-life examples? - Is it possible to somehow intercept WEB Pushes from PWA and display them natively? If yes, how to do it?
- Why are there no notifications from my PWA from Chrome when the TWA app is installed?