In order to delete a tag you just update the registration with a set of tags that does not contain it. E.g.
SBRegistration* toUpdate = [hub retrieveNativeRegistrationWithError: nil];
[[toUpdate tags] addObjectsFromArray: @[@"myNewTag1", @"myOtherNewTag"]];
[hub updateRegistration:toUpdate];
Or Async:
[hub retrieveNativeRegistrationWithCompletion:^(SBRegistration* r, NSError* e) {
if (r == nil) ; // error handling
[[r tags] addObjectsFromArray:@[@"myNewTag", @"myOtherNewTag"]];
[hub updateRegistration:r completion:^(SBRegistration* r2, NSError* e) {
// error mgmt;
}];
}];
Also, note that when you call createNativeRegistration you will overwrite the current set of tags. This naming inconsistency is getting fixed in the next release of the iOS SDK.
At this moment you cannot retrieve count by tag, but (from the back-end) you can retrieve all registrations with a tag (an inefficient a way to count). You can do it from the back-end .NET SDK, using:
var skip = 0;
var increment = 100;
IEnumerable<RegistrationDescription> regs = hubClient.GetRegistrationsByTag("myTag", skip, increment);
while (regs.Count() != 0)
{
foreach (var i in regs)
{
// do work
}
skip += increment + 1;
regs = hubClient.GetRegistrationsByTag("myTag", skip, increment);
}
Or using our REST surface: GetRegistrationsByTag
Thanks,
Elio