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

半城伤御伤魂 提交于 2019-12-22 12:01:31

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/38678599/can-i-create-subtopics-when-using-firebase-cloud-messaging-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!