I'm using the topic as a unique identifier per user, so there won't be any users that are subscribed to a "general" topic that will send out the same notification to multiple users
I think each user should subscribe to a "private" topic (unique user id)
and more than one "public" topic (such as general, cats, dogs, etc)
Eg.
user id = 001
topic = 001, general, cats
user id = 002
topic = 002, general, dogs
user id = 003
topic = 003, general, dogs
If I have different topics though that I want to send out, and I want to send them all out in one api call, how would I group all of the topics/messages together?
I never tried to group topics but according to Firebase doc, it says that we can use condition.
Maybe in the sending tool, we can put the condition in the map.
Dim message As Map = CreateMap("condition": "'dogs' in topics || 'cats' in topics", "notification": notification, "data": data)
You can include up to five topics in your conditional expression.
If things become more complicated or you have a lot of users, I think you need to figure out how to group your unique users on your server/sending tool with a database.
When the app starts, subscribe/unsubscribe topics in the background when it is necessary.