Reputation: 141
By using TWA, we developed an Android application that opens a PWA page without a Address bar.
But there was a problem.
Since the Address bar is not displayed, it is troublesome when you want to switch web Push Notification.
There are ways to switch, but to do this you have to open a new chrome once. Turn notifications on or off
But this is awkward. Not kind.
However, I cannot come up with any other method.
If possible, I would like to do it if it can be realized by either of the following methods, but I do not know at all how to do it. By the way, the site is SPA using Vue.js.
Open Android web Push Notification setting screen from javascript code.
Open new chrome when button action is triggered. (in same domain)
I honestly think that it is impossible.
However, I asked this question because I did not want to give up hope.
If you have any hints, please let me know.
Thank you.
Upvotes: 1
Views: 694
Reputation: 447
TWAs essentially still runs on the chrome engine so everything that you can do with a website in chrome (except through the address bar), you can still do in a TWA.
Hence request permission from the user using the notification API.
Here's a detailed explanation to it.
https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission
Upvotes: 1