19
votes

I am trying to create a web application which receives notification from Azure Notification Hub.

Everywhere I only see mobile devices registering for notifications sent from back-end.

I want this web application to be used in browser and receives notification from Azure Notification Hub sent from back-end.

Thanks

2
Has anything changed here? Are services buses still the right component to achieve notifications in a web app? Maybe relevant: docs.microsoft.com/en-us/azure/event-grid/…leonheess

2 Answers

12
votes

Nope.

Azure Notification Hubs are exclusively for push notifications for mobile platforms.

If you want a code to receive a notification you shall take a look at Azure Service Bus Queues, Topics and Subscriptions. Then decide which of all to use.

It is mentioned in Notification Hubs FAQ (Do you support text message, email, or web notifications?) that you can do it by using SignalR on top of Notification Hubs :

Customers can implement this feature using SignalR on top of the supported server-side platforms.

5
votes

As mentioned in previous answers Azure's Notification Hubs only work for mobile devices because behind the scenes it interacts with the various mobile platforms' push notification services such as the Apple Push Notification Service (APNS). It is not sending the notifications directly to the client. Since there are no push notification services for websites you need another technology.

Azure offers Service Bus Queues which would work, but it also offers SignalR which is probably the best solution in your case, and in fact the one I plan to use for a web frontend I am building for my service. SignalR handles all the low level connection details for you, i.e. it takes care of using the optimal protocol for the browser you are running in which is no mean task! It's fast, scalable and surprisingly easy to implement.