简体   繁体   English

设备注册后将推送通知标签添加到Azure通知中心

[英]Adding push notification tags to Azure Notification Hub after device registration

We are using Azure Notification Hub for push notifications to our app. 我们正在使用Azure Notification Hub将推送通知推送到我们的应用程序。 All works really well and we can send push notifications to both Android and iOS devices. 一切都运行良好,我们可以将推送通知发送到Android和iOS设备。

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? 还是我们每次要推出新标签时都必须重新注册设备?

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. 该示例使用Tag获取先前的注册,尽管您也应该能够通过registrationId进行搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 通知中心设备注册 - Azure Notification Hub device registration 为Azure通知中心推送通知 - Push notification for azure notification hub 我们允许每个设备为Azure推送通知中心注册多少个标签 - How many tags we are allow to register per device for Azure push notification hub 尝试使用特定设备标签通过 Rest API 向 Azure 通知中心发送推送通知 - Trying to send push notification to Azure Notification Hub via Rest API using specific device tag iOS 使用 Azure 通知中心推送通知 - iOS Push Notifications with Azure Notification Hub 使用Azure Notification Hub在Xamarin Forms上注册Android设备以进行推送通知 - Registering an Android device for push notifications on Xamarin Forms using Azure Notification Hub 如何将 Azure 通知中心中 iOS 设备注册的到期日期设置为 31-12-9999 23:59:59? - How to set the expiration date of an iOS device registration in Azure Notification Hub to 31-12-9999 23:59:59? 从Azure通知中心(Xamarin.iOS)推送通知 - Push notifications from Azure Notification Hub (Xamarin.iOS) Xamarin.Android将通知GCM推送到Azure通知中心 - Xamarin.Android push notifications GCM to Azure Notification Hub 设备未在Xamarin形式的Azure推送通知中心中注册 - Devices are not registered in azure push notification hub in xamarin forms
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM