Microsoft.Azure.NotificationHubs 4.1.0
Today we release the Azure Notification Hubs SDK for .NET version 4.1 with some new features.
New Features
There are some new features in this release including:
- Push to User
Push to User
With the Installation API we now have a new feature that allows you to associate a user ID with an installation and then be able to target it with a send to all devices for that user. To set the user ID for the installation, set the UserId
property of the Installation
.
var installation = new Installation();
installation.UserId = "user1234";
await hub.CreateOrUpdateInstallationAsync(installation);
The user can then be targeted to send a notification with the tag format of $UserId:{USER_ID}
, for example like the following:
var jsonPayload = "{\"aps\":{\"alert\":\"Notification Hub test notification\"}}";
var tags = new string [] { "$UserId:user1234" };
var notificationOutcome = await hub.SendAppleNativeNotificationAsync(jsonPayload, tags);
Bug Fixes
- #155 Fix
Content-Type
for each Notification Type