I have made a Java app in which users can chat I what to add a feature through which when a user clicks on Button View a notification will be send to all users using FCM or Firebase Cloud Messaging
Asked
Active
Viewed 177 times
0
-
1what prevents you from doing it? – Avital Jun 13 '22 at 07:25
-
1use subscribe to any topics topics for all users – Vijay S Jun 13 '22 at 08:03
-
*firebaser here* Calls to the FCM REST API to *send* messages require that you specify the FCM *server** key in your code. As its name implies, this key should only be used in server-side code, or in an otherwise trusted environment. So there is no way to directly send a message from one device to another. See https://stackoverflow.com/a/37993724 for a better solution. – Frank van Puffelen Jun 13 '22 at 12:20