FCM send messages to topic in specific app

拟墨画扇 提交于 2020-07-23 08:01:04

问题


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

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