简体   繁体   English

我们可以注册 Web 应用程序以接收来自 Azure 通知中心的通知吗?

[英]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.

相关问题 Azure 通知中心示例,用于注册设备并接收通知 - Azure Notification Hub example to register a device and receive a notification PWA 仅使用 JS 为 Azure 通知中心注册推送通知 - PWA register push notifications for Azure Notification Hub using JS only 如何从iOS在Azure移动应用通知中心注册有针对性的推送通知 - How to register for targeted Push Notifications in Azure Mobile App notification hub from iOS 为什么 iOS 设备可能不会收到来自 Azure 推送通知中心的推送通知? - Why iOS devices might not receive push notifications from Azure push notification hub? 我们可以直接使用Azure通知中心连接Azure事件中心吗? - Can we Connect directly the Azure Event Hub With Azure Notification Hub? 我们可以将天蓝色事件中心与天蓝色通知中心连接吗? - Can we connect azure event hub with azure notification hub? 在 Azure 通知集线器上注册设备 - Register device on Azure notifications hub 将通知模板从App Backend注册到Azure通知中心 - Register notification template from App Backend to Azure notification Hub 如何通过Web App向Azure Notification Hub注册远程设备 - How to register remote device with Azure Notification Hub via Web App Azure通知中心无法将模板注册为可用内容 - Azure notifications hub can't register template with content-available
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM