dotnet-presentations / blazor-workshop

Blazor workshop
https://aka.ms/blazorworkshop
MIT License
3.49k stars 1.55k forks source link

Push notification doesn't work for me #313

Open erossini opened 3 years ago

erossini commented 3 years ago

I tried to run the application in the browser and installed it as an app but I can't received the push notifications.

Apparently, the app is sending the notification via WebPushClient.

image

In the client point of view, there is nothing related to the push notification.

image

I allowed to show push notification in the browser.

SpikeViper commented 3 years ago

There seems to be an issue related to Blazor and push notifications. I cannot get them working in my own app, and I turned to this project to find the solution - but alas, they don't work here either!

I threw my own Vapid keys in and through debugging I can see the SendNotificationAsync function is getting a 401 response.

I am able to get push notifications working with another example project that is using AspNetCore, making me think this issue must be blazor-related.

emprosenterprises commented 2 years ago

push notification not work for me too. Notification is not showing in Action center after installing as PWA.

ChauThan commented 2 years ago

Do you guys get SSL exception?

Error sending push notification: The SSL connection could not be established, see inner exception.

I tried HttpClientHandler but it doesn't work.

ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
SpikeViper commented 2 years ago

It has been over a year. Some details on how to fix this would be nice!

rjean99 commented 9 months ago

Once I deployed to Azure then push notifications work in the runtime. I get the 401 errors in dev.