I'm currently replacing PostSharp with Azure Notification Hub as post sharp seems to have stopped working in Azure. I have setup my app and it registers its device tag with Azure. I have tested a push notification from the Azure portal broadcasting to all and it works.
However I want to amend my Web API project so I can send notifications to a specific device. Here the code that I have got so far where device tag is the device tag of the iPhone:
var alert = "{\"aps\":{\"alert\":\"Hello from .NET!\"}}";
await hub.SendAppleNativeNotificationAsync(alert, new List<string> { deviceTag });
This does not work however. I thought I could just send the device tag similar to how post sharp works? I'm a little confused as I know this device has successfully registered with the hub in Azure, because if I do a test broadcast from the portal it receives a notification. How do I amend my API code to send to just a specific device? I came across this article https://azure.microsoft.com/en-gb/documentation/articles/notification-hubs-aspnet-backend-windows-dotnet-wns-notification/ but it seems odd, as I already know the device token. Is it possible to send a notification to the hub and specify the device tag?