Reputation: 113
I am using the old Firebase Cloud Messaging API. I can send notifications to all my users with the application that I made. But as I watched tutorials, I realized that it is not good to expose your Server Key in your app because apps can be reverse engineered. So, is there any way to send notifications to all users without your server key being exposed? How?
Upvotes: 0
Views: 196
Reputation: 2905
Answering this as community wiki.As mentioned above in comments by Frank van Puffelen
As you discovered anyone who has the FCM server key can send whatever message they want to all of your users. By including this key in your Android app, a malicious user can find it and you're putting your users at risk.
You can check this stackoverflow thread for a better solution.
Upvotes: 1