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.
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.
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?