react-push-notification icon indicating copy to clipboard operation
react-push-notification copied to clipboard

Native push notifiation not working on mobile device (Chrome)

Open ase-dcexpert opened this issue 4 years ago • 0 comments

Hi,

showing notifications (version 1.3.0., native:true) on Windows 10 Chrome works fine. When loading the same page on my mobile device with Chrome, I get the following error:

Unhandled Rejection (TypeError): Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.

The stack trace is:

Storage.<anonymous>

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:54

(anonymous function)

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:8

push../node_modules/react-push-notification/dist/notifications/Storage.js.__awaiter

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:4

Storage.addNativeNotification

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:48

Storage.<anonymous>

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:81

(anonymous function)

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:8

push../node_modules/react-push-notification/dist/notifications/Storage.js.__awaiter

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:4

Storage.addNotification

D:/VIDEOS/parfumo-souk-notifications/node_modules/react-push-notification/dist/notifications/Storage.js:78

In my code I am just using the addNotification() function as described in the documentation here.

Thanks for helping and kind regards,

Alexander

ase-dcexpert avatar Jun 17 '20 08:06 ase-dcexpert