Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create subtopics when using Firebase Cloud Messaging (for Android)?

I'm currently developing an app that uses the new firebase cloud messaging system. Now I see the topic feature of FCM.

I created a topic "news" and want to add sub topics e.g "news/weather" or "news/politics".

Altogether there are about 20 subtopics.

Is this even possible with FCM and is this god practice?

like image 243
ForJ9 Avatar asked Jul 01 '26 18:07

ForJ9


1 Answers

I usually start my topics with a prefix and then the subtopic, separating them with a _.

So if I have a sub-topic per user (great for sending user-to-user messages) I end up with:

/topics/users_puf
/topics/users_forj9

There might be better ways, so I hope others will answer too.

like image 55
Frank van Puffelen Avatar answered Jul 04 '26 08:07

Frank van Puffelen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!