Topics
Subscribe devices to topics for targeted group messaging — news categories, user preferences, geographic targeting, app features.
Subscribe to topics for targeted group messaging.
What are Topics?#
Topics allow you to send messages to groups of devices that have subscribed to a specific topic. Useful for:
- News categories — sports, tech, entertainment
- User preferences — promotions, updates, alerts
- Geographic targeting — cities, regions, stores
- App features — beta users, premium members
Subscribe to Topics#
Flutter
// Subscribe to a single topic
await AbrovaPush.subscribeTopic('news');
await AbrovaPush.subscribeTopic('promotions');
await AbrovaPush.subscribeTopic('sports');
// Subscribe to several topics: call subscribeTopic once per topic
for (final topic in ['tech', 'gaming', 'movies']) {
await AbrovaPush.subscribeTopic(topic);
}React Native
// Subscribe to a topic
await AbrovaPush.subscribeTopic('news');
await AbrovaPush.subscribeTopic('promotions');Android (Kotlin)
// Subscribe to a topic
AbrovaPush.subscribeTopic("news")
AbrovaPush.subscribeTopic("promotions")
AbrovaPush.subscribeTopic("sports")iOS (Swift)
// Subscribe to a topic
AbrovaPush.shared.subscribeTopic("news")
AbrovaPush.shared.subscribeTopic("promotions")
AbrovaPush.shared.subscribeTopic("sports")Web
// Subscribe to a topic
await abrovaPush.subscribeTopic('news');
await abrovaPush.subscribeTopic('promotions');Unsubscribe from Topics#
Flutter
// Unsubscribe from a single topic
await AbrovaPush.unsubscribeTopic('promotions');
// Unsubscribe from several topics: call unsubscribeTopic once per topic
for (final topic in ['sports', 'gaming']) {
await AbrovaPush.unsubscribeTopic(topic);
}React Native
await AbrovaPush.unsubscribeTopic('promotions');Android (Kotlin)
// Unsubscribe from a single topic
AbrovaPush.unsubscribeTopic("promotions")iOS (Swift)
// Unsubscribe from a single topic
AbrovaPush.shared.unsubscribeTopic("promotions")Web
await abrovaPush.unsubscribeTopic('promotions');Get Subscribed Topics#
The client SDKs do not expose a method to list a device's subscribed topics. Keep track of the topics your app subscribes to (for example in local storage), or open a device's profile in Abrova Console (Abrova Push → Devices) to see its topics. On the server, segment previews (abrovaPush.segments.preview()) include each matching device's topics, and a segment filter on the topics field targets subscribers of a topic.
Topic Naming Rules#
Topic names aren't validated by the server, so stick to these conventions:
- Use lowercase letters, numbers, and underscores
- Avoid spaces, commas and the characters
/,#,+in topic names. - Topic names are case-sensitive:
Newsandnewsare different topics - Examples:
news,sports_updates,store_123