0
votes

We are using Azure Notification Hub for push notifications to our app. All works really well and we can send push notifications to both Android and iOS devices.

We would like to start using tags when sending push notifications to target specific groups of our user base. We want to add new tags in the future.

In all the code examples I see, the tags are registered during the device registration process. Can you add tags completely separately to the device registration process? Or do we have to re-register the device each time we want to roll out new tags?

1

1 Answers

2
votes

This link example seems to be solving the same problem you have:

var registrations = await hub.GetRegistrationsByTagAsync("{userId}", 10);
foreach (var reg in registrations)
{
  reg.Tags.Add("{newBand}");
  await hub.UpdateRegistrationAsync(reg);
}

The example gets previous registrations using a Tag although you should be able to search by registrationId as well.