Skip to content

Native push notifiation not working on mobile device (Chrome) #1

@ase-dcexpert

Description

@ase-dcexpert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions