问题
I've two android apps that share same project in firebase infrastructure
When i was preparing the firebase infrastructue to run the second one i decided for creating a second app in the same firebase project as the first one... this was a decision made basically because i hated the firebase "switch between projects" tools.
both apps ran great for over a year being hosted as same project although not sharing real resources
BUT NOW I RUN INTO A PROBLEM
I added FCM into the apps and i cant find a way to send messages to topics in a specific app...
firebase let me only choose between send message to specific app or specific topic...
both apps have same topics names and now if any user has both of them installed at the phone i cant imagine how firebase will behave when i send a notification to a topic the user has two different apps subscribed to.
does anyone know how to solve this?
回答1:
You can't stop the message from going to both apps. But what you can do is put something in the message to say which app it was intended to go to. The app can then choose to ignore messages it's not supposed to handle.
来源:https://stackoverflow.com/questions/61668088/fcm-send-messages-to-topic-in-specific-app