fabioshub / react-push-notification

Push notification library for React.js
46 stars 18 forks source link

Native push notifiation not working on mobile device #5

Open GitanjaliCS opened 3 years ago

GitanjaliCS commented 3 years ago

Please help!

Push notification is not working on any mobile device. I tries whole day to solve this problem. Please help me.

    addNotification({
            title: 'Test',
            message: 'Message',
            theme: 'darkblue',
            duration: 5000,
            native: true, 
            silent: false
     });

What is wrong in my code?

fabioshub commented 3 years ago

Can you try disabling native, by setting native: false?

GitanjaliCS commented 3 years ago

Ok I will try and will update you.

On Mon, Mar 15, 2021 at 7:32 PM fabioshub @.***> wrote:

Can you try disabling native, by setting native: false?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fabioshub/react-push-notification/issues/5#issuecomment-799444477, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOREIXUVZJAQ3OJKKLNFOX3TDYHOPANCNFSM4ZGTMDZA .

-- Regards, Gitanjali Gurram

Creative Skills Digital Pvt Ltd.

GitanjaliCS commented 3 years ago

Hi,

If I set native: false then its not working on both device mobile and desktop. How to solve this problem?

Please help me in this issue. It is very urgent for me.

On Tue, Mar 16, 2021 at 4:32 AM Gitanjali Gurram @.***> wrote:

Ok I will try and will update you.

On Mon, Mar 15, 2021 at 7:32 PM fabioshub @.***> wrote:

Can you try disabling native, by setting native: false?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fabioshub/react-push-notification/issues/5#issuecomment-799444477, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOREIXUVZJAQ3OJKKLNFOX3TDYHOPANCNFSM4ZGTMDZA .

-- Regards, Gitanjali Gurram

Creative Skills Digital Pvt Ltd.

-- Regards, Gitanjali Gurram

Creative Skills Digital Pvt Ltd.

caioaao commented 3 years ago

This is due to mobile not supporting the Notification constructor 1 which is used in this library. From what I've found online, the only way around it is implementing it yourself using service workers.

faizbyp commented 1 year ago

I have the same issue, any reference on how to fix that? I want to implement push notification to my React PWA