Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

How to add tags in UrbanAirship in Xamarin.Forms?

Prakash Bambhania

We have following code to add tags in urbanairship for portal user. But I am not getting any tags. Can anybody please suggest me if I am doing wrongly. I want to add tags for registered user.

Project.iOS(Native)
Code to register identifier
UAirship.NamedUser.Identifier = "ssccr-cr529-dv689-1558e-6265d";
UAirship.NamedUser.ForceUpdate();

Project(Portalable)
Add Tags
Airship.Instance.EditDeviceTags().AddTags(tags).Apply();

Remove Tags
Airship.Instance.EditDeviceTags().RemoveTags(tags).Apply();

Please sign in to leave a comment.

0
Avatar

Prakash,

Your code looks to be correct.

Where in your Urban Airship project are you checking for tags?

Tags are used for sending push to segments of your audience. 

The first way I would check if the tags are added is by using the Tags getter method:

List<string> tags = Airship.Instance.Tags;

Next, when sending a push in the dashboard, use the Target Specific Devices option to create a segment composed of one or more tags. These tags would be the ones you set in the app.

Michael Halka 0 votes