You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome mobile will not show native browser notifications via new Notification(...). It uses modern Service Workers approach. Here is a link for solutions of how to show and how to detect this behavior.
The text was updated successfully, but these errors were encountered:
Please be aware that Chrome on Android won't support desktop notifications through new Notification(…). See this issue and that one.
This issue should be marked as a bug because pNotify desktop module will fail on that platform.
Using ServiceWorker notifications is out of the scope of pNotify, so the solution should be, like some contributors noted, trying creating a Notification object first and catching the exception if any:
functionisNewNotificationSupported(){if(!window.Notification||!Notification.requestPermission)returnfalse;if(Notification.permission=='granted')thrownewError('You must only call this *before* calling Notification.requestPermission(), otherwise this feature detect would bug the user with an actual notification!');try{newNotification('');}catch(e){if(e.name=='TypeError')returnfalse;}returntrue;}
This code should be used in Component.permission in PNotifyDesktop.html
Chrome mobile will not show native browser notifications via
new Notification(...)
. It uses modern Service Workers approach. Here is a link for solutions of how to show and how to detect this behavior.The text was updated successfully, but these errors were encountered: