Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
819 views
in Technique[技术] by (71.8m points)

push notification - Can Service Workers receive pushes when not installed on mobile?

I think I know the answer to this question from my experiments, but I haven't been able to find a definitive answer when doing research.

Is is possible to send notifications to a PWA when it is opened in Chrome on mobile, but isn't installed?

Once it is installed I can receive notifications, but I can't before.

I'm having a hard time getting remote debugging working for my mobile so it's difficult to tell if the push event is even firing.

question from:https://stackoverflow.com/questions/65645057/can-service-workers-receive-pushes-when-not-installed-on-mobile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The docs, don't specify the need to install the pwa to be able to use the notification feature. However what I suspect is happening in your case is that Chrome is not giving priority to notify to the notification that you are sending without installing. What I mean is that you might receive your notification on the regular wakeup cycle of Chrome, and not as a background task. (But this is just a speculation)

Another common scenario that happens a lot, trust me :-), is that you forgot to give permission to send notifications in the first place.

Regarding remote debugging, refer the docs, to get it setup on Android. As a lot of the online tutorials are a bit out of date.

Note: I found an article online that shows a notification received without installing on Android, here is its link, it might not be very helpful for your case but check it out you might figure something out.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...