question

erossini avatar image
0 Votes"
erossini asked TimonYang-MSFT edited

ASP.NET Core web notification implementation

For the intranet company, I want to send to user web notification. This notification could be general (new feature in the intranet) or for a specific user (a task is ready to pick up or an import is completed).

I started to use SignalR but the user receives the notification only if the intranet is open. So, I'm looking around to implement a different web notification and I saw some posts:

I can't find an end-to-end implementation in ASP.NET Core. On GitHub I found a few projects but again when I close the browser, I can't receive the notification.

I can't find any Microsoft documentation for that. What I understood is that I have to create the following parts:

  • Setting up a minimal PWA

  • Subscribe to Push Notifications

  • Send Push Notifications

  • Receive Push Notifications

  • Show Push Notifications


I can't find any end-to-end example for that. Can you point me in the right direction please?



dotnet-csharpdotnet-aspnet-core-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Push notifications only apply to mobile devices. There's no mechanism for a server to send data to a closed browser on a desktop system. The only option is installing an application that runs on the remote desktop.

Otherwise, take advantage of HTTP as intended. Show the user what's new the next time they access the site. Or perhaps design a scheduled task that sends an email to user's at some frequency.

0 Votes 0 ·

Yes, you can. It is called web push notification. There are some examples in the links I inserted

0 Votes 0 ·

1 Answer

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

Web notifications are typically implemented as a service worker, not a PWA. The api allows a the browser JavaScript to add a notification. Typically the JavaScript polls for the notice, and can only receive the notice if it is running. Thus the use of the service worker.

You are probably thinking of the o/s notifications, that don’t require a browser. While first available for mobile o/s most desks support now. There is a different api for each platform you want to notify. So typically you use a cloud provider which has support for all platforms and acts as a gateway. See azure communication service as an example


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.