[英]Can we register a web application to receive notifications from Azure Notification Hub?
I am trying to create a web application which receives notification from Azure Notification Hub.我正在尝试创建一个从 Azure 通知中心接收通知的 Web 应用程序。
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.我希望在浏览器中使用此 Web 应用程序并接收来自后端发送的 Azure 通知中心的通知。
Thanks谢谢
Nope.不。
Azure Notification Hubs are exclusively for push notifications for mobile platforms. Azure 通知中心专用于移动平台的推送通知。
If you want a code to receive a notification you shall take a look at Azure Service Bus Queues, Topics and Subscriptions .如果您希望代码接收通知,则应查看Azure 服务总线队列、主题和订阅。 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 : 通知中心常见问题解答(您是否支持文本消息、电子邮件或 Web 通知?)中提到,您可以通过在通知中心之上使用SignalR来实现:
Customers can implement this feature using SignalR on top of the supported server-side platforms.
客户可以在受支持的服务器端平台上使用 SignalR 实现此功能。
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).正如之前的回答中提到的,Azure 的通知中心仅适用于移动设备,因为在幕后它与各种移动平台的推送通知服务(例如 Apple 推送通知服务 (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. Azure 提供了可以工作的服务总线队列,但它也提供了SignalR ,这可能是您的最佳解决方案,事实上,我计划将其用于为我的服务构建的 Web 前端。 SignalR handles all the low level connection details for you, ie it takes care of using the optimal protocol for the browser you are running in which is no mean task!
SignalR 为您处理所有低级连接细节,即它负责为您正在运行的浏览器使用最佳协议,这绝非易事! It's fast, scalable and surprisingly easy to implement.
它快速、可扩展并且非常容易实施。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.