Windows Azure的ServiceBus推送通知APNS架构 [英] Windows Azure ServiceBus Push Notifications APNS Architecture
问题描述
我建立托管在Windows Azure上的应用程序将通过APNS向用户发送消息在iPhone上。我使用的是服务总线通知中心,而不是移动电话服务我有一个使用RavenDB和队列现有持久性的基础设施。
I am building an application hosted on windows azure which will send messages to users on iphones through the apns. I am using a service bus notification hub rather than a mobile service as I have an existing persistence infrastructure using RavenDB and queues.
说这是我通知服务的发送给Apple的方法:
Say this is my notification service's send to apple method:
public async void SendAppleNotificationAsync(INotification notification)
{
var hub = NotificationHubClient.CreateClientFromConnectionString(
_configService.Get<NotificationConfig>().ConnectionString,
_configService.Get<NotificationConfig>().Hub);
var appleNotification = new AppleNotification(notification.ToJsonString(), new DateTime());
await hub.SendNotificationAsync(appleNotification);
}
什么我无法找出是如何将通知发送到特定的设备,因为我已经从存储在我的服务器端应用程序的苹果用户的设备令牌。
What I am unable to work out is how to send a notification to a specific device, given I have the user's device token from apple stored in my server side application.
我希望的API有这样的方法:
I was hoping the api had a method like this:
var appleNotification = new AppleNotification(deviceToken, notification.ToJsonString(), new DateTime());
但我似乎并没有能够找到任何提及针对特定的设备。
But I don't seem to be able to find any reference to targeting a specific device.
我缺少的东西的图片根本?
Am I missing something fundamental to the picture?
推荐答案
通知集线器可以用来批量通知发送到用户组或单用户。它基本上是一个发布/订阅模式。客户端订阅一个主题,则服务器将发布通知该主题。一个客户端可能订阅一个广泛的话题促销或窄主题用户:123456。本文提供了例如code和使用通知集线器将消息发送给单个客户端的演练。
Notification Hubs can be used to send out bulk notifications to groups of users, or to single users. It is basically a publish/subscribe model. The client subscribes to a topic and the server publishes notifications to that topic. A client might subscribe to a broad topic "promotions" or a narrow topic "user:123456". This article gives example code and a walkthrough of using Notification Hubs to send a message to a single client.
<一个href=\"http://www.windowsazure.com/en-us/documentation/articles/notification-hubs-aspnet-notify-users/\" rel=\"nofollow\">http://www.windowsazure.com/en-us/documentation/articles/notification-hubs-aspnet-notify-users/
这篇关于Windows Azure的ServiceBus推送通知APNS架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!