[PWA PushWoosh Sample] Unable to receive notifications on PWA App.

Forge Component
(0)
Published on 23 Apr by Ricardo Costa
0 votes
Published on 23 Apr by Ricardo Costa

Hello Recardo ,


Thanks for this component and i tried this with my own PW credentials(App code and Sender ID) and alterations but Unable to receive notifications on my PWA App running on chrome browser.


Strange issue is that its able to subscribe user and i can see count increasing in chrome subscriber in PW console but the notification is not delivered/flashed/received on chrome browser .


Could you please let me know possible issues in my code.


Regards ,

Nitesh

Hello Nitesh.

Can you share with me what you are getting in the Console?


Ricardo

Ricardo Costa wrote:

Hello Nitesh.

Can you share with me what you are getting in the Console?


Ricardo

Hello Recardo ,

Here's my console log :

Where only errror is shown for favicon icon not found .

Hope this may help you finding the issue.


Regards,

Nitesh

Hello.

That t object is the notification object. So, you are receiving the push notifications.

The Chrome browser however is not popping it up.

Can you try Firefox to see if the notification is popped up?

If so, you must search for settings on your chrome browser that may be blocking the notification pop up.


Thank you,

Ricardo

Ricardo Costa wrote:

Hello.

That t object is the notification object. So, you are receiving the push notifications.

The Chrome browser however is not popping it up.

Can you try Firefox to see if the notification is popped up?

If so, you must search for settings on your chrome browser that may be blocking the notification pop up.


Thank you,

Ricardo

Hi Recardo ,

t object is created at page load itself, even before sending a notification from pushwoosh console. 

I have also checked chrome settings and also confirmed that notifications are allowed for my app .

And also i have checked with other demo web apps which able to send and receive notifications on chrome but only this is not able to receive notifications.

Since this is a PWA currently firefox on my office laptop does not supports running PWA . 


Hello Nitesh.

You are right about the t object. I thought it was the notification one but it's not.

And you are also right about the Chrome issue.

Although on my phone Chrome it's working:

And even though it's a PWA you can run it as a normal web app in firefox and it's also working.


So, I'm out of ideas for the Chrome issue and also out of time, since I'm allocated to something else.

Try to see in the push woosh community if someone is having the same issue.

Meanwhile I will try to contact the PushWoosh support.


Thank you,

Ricardo

Hello Nitesh.

I've uploaded a new version that fixes the problem you reported.

It's not the most desirable solution and I will try to find a better one, but it's the possible solution at the moment.

You will have to copy the content it's being generated by the platform to the pwaServiceWorker.js file and append in the beginning the "importScripts('https://cdn.pushwoosh.com/webpush/v3/pushwoosh-service-worker.js' + self.location.search)". Include the resulting file as a resource (pwaServiceWorkerNew.js) and update the InitPushWoosh script with the new logic of the sample.

Thank you,

Ricardo Costa

Ricardo Costa wrote:

Hello Nitesh.

I've uploaded a new version that fixes the problem you reported.

It's not the most desirable solution and I will try to find a better one, but it's the possible solution at the moment.

You will have to copy the content it's being generated by the platform to the pwaServiceWorker.js file and append in the beginning the "importScripts('https://cdn.pushwoosh.com/webpush/v3/pushwoosh-service-worker.js' + self.location.search)". Include the resulting file as a resource (pwaServiceWorkerNew.js) and update the InitPushWoosh script with the new logic of the sample.

Thank you,

Ricardo Costa

Hey Recardo,

Thanks for the help :) , i will surely try this temporary solution and will let you know the outcome.


Regards,

Nitesh