Skip to content

Azure Notification Hubs SDK for Apple 3.1.0

Compare
Choose a tag to compare
@mpodwysocki mpodwysocki released this 17 Aug 22:35
· 4 commits to master since this release
5f899cb

This release adds the Push to User functionality to the Azure Notification Hubs SDK for Apple.

Push to User

The SDK supports the ability to associate a user with an installation. This allows you to be able to target all devices associated with a particular User ID. The user's identity set through the SDK can be whatever the developer wants it to be: the user's name, email address, phone number, or some other unique identifier. This is supported through the MSNotificationHub and the setUserId method.

Swift:

let userId = "iosUser123"
MSNotificationHub.setUserId(userId);

Objective-C:

NSString *userId = @"iosUser123";
[MSNotificationHub setUserId:userId];
To target a particular user on the backend, you can specify a tag such as $UserId:{VALUE} where VALUE is the user name you have specified, just as you can target an installation using the $InstallationId:{VALUE} tag.