Suppose a PWA added to home screen,we have an event, and we want to open the app (progressive web application) when the event fired.
For example in service worker, we check the server (API) every our ,and when the result is OK, PWA open and show some details (or ...).
How we can do it?
And what is the code for open PWA automatically?
Note that we don't want to do this with notifications.
Related
I have a flutter application that receives FCM Data messages.
On each data message, I create a respective notification locally using the awesome_notifications library. I have 2 action buttons on the notification. The action button click navigates me to a specific page when the application is in the foreground or background(paused).
But, the same click action doesn't work when the app is terminated/killed. Instead of navigating to some page, it just opens the application's homepage.
I'm listening to actionStream, but it seems it doesn't work when the app is terminated.
If anyone has a solution to this, it would be beneficial!
So Suppose we have a pwa app say X. When we install that app on homescreen, do we get two service workers one on browser say chrome and one in the native app? How push notifications will work in such cases, do we have to get subscription for native app separately for sending push notification to service worker of native app. And will these notifications appear in app or on chrome browser?
P.S By native app I mean pwa app installed on homescreen
Add to home screen does not add a native app to your device or desktop. It's still using browser resources. There's one service worker and one push notifications flow.
The scenario looks like this.
User installs our PWA app on windows desktop https://test.app.com
He gets a notification from the system and clicks on the link in outlook
https://test.app.com/test/123.
I expect the link to be loaded in PWA while it opens the browser. Is it possible to use intent filters like in android?
We've PWA where user has not allowed notification to be shown first time ( when website is opened first time and notification dialog is shown ).
But user has installed PWA to mobile home screen.
Later user opens the website again and by tapping on lock icon allows notification.
Even after this, user doesn't get to see new notification.
Please clarify how to fix notification in this case.
I am wondering whether there is any JS API to start another chrome app on button click event in a chrome packaged app.
As a general rule, no, you can't invoke another app.
However, if you control both apps, you can set the second app to expect an external message.
You can add chrome.runtime.onMessageExternal listener to the second app's event page script, and send a message with the app ID from the first to wake the second app and launch the app window. See this for more details.
In general, an extension can do this task and more thanks to the management API. It is, however, unavailable for Apps as of now.
Feature request to add this API for apps: #455550