Tagging is a flexible way to send push notifications to segments of your users. Your users can be assigned to a tag with just one line of code. 

Here are some use cases of how tags can be useful: 

  • A news app will use tags to send fashion news to only those who are interested in fashion, and politics to those who are interested in politics. 

  • A food app can send certain deals to those who like burger and meat. 

  • A travel app might have have a tag for each country so that it can send promotions based on users preferences for destinations. 

How to set tags


Android 

Inside onCreate() Method of your Activity add the following:

JSONArray tags = new JSONArray();
tags.put("tag1");
tags.put("tag2");
Pushbots.sharedInstance().tag(tags);


Phonegap 

window.plugins.PushbotsPlugin.tag("tag1");
//Remove tag
window.plugins.PushbotsPlugin.untag("tag1");

//Add array of tags
window.plugins.PushbotsPlugin.setTags(["tag1"]);
//Remove array of tags
window.plugins.PushbotsPlugin.removeTags(["tag1"]);

After setting your tags you can now go to the dashboard, and open your push composer and use the tags text area to specify the message to a certain audience 


Did this answer your question?