sachiko-kame
sachiko-kame

Reputation: 141

If I want to switch web Notifications with Android TWA Must I bother to open Chrome?

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.

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

Answers (1)

Emmanuel
Emmanuel

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

Related Questions