Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
997 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...