0

I need help with a feature in my project, what I want to achieve is as follows: A user clicks a button, then push notifications are sent to all the users in the same group. that's it. I'm using the firebase database and I set up FCM but didn't understand how to make it work without the console. are there other technologies that can achieve this?

Tom Cohen
  • 79
  • 6
  • https://stackoverflow.com/questions/71299214/send-notification-to-specific-user-firebase-in-flutter#:~:text=This%20can%20simply%20be%20done,token%20to%20send%20it%20to. is what you are looking for – Ozan Taskiran Oct 24 '22 at 20:03
  • 2
    ^ don't. `key=REPLACETHISWITHYOURAPIKEY` will get your app kicked out of the store if google finds out. https://stackoverflow.com/questions/70784460/leaked-gcp-fcm-server-keys-your-apps-expose-fcm-server-keys - Apps **can not** send FCM Push messages themselves. You do need a "trusted environment" like a server, cloud function... – zapl Oct 24 '22 at 20:36
  • Thank you all for your answers they do answer my question and help me out a lot! @zapl you're probably right but, I'm not planning to publish the app in the stores so it's not a concern. – Tom Cohen Oct 25 '22 at 13:24
  • @zapl I am the one who answered that question. I'm working on improving that answer and wanted to know more about trusted environment and the security issues regarding my answer. Thanks in advance – Mohammad Abd-Elmoniem Dec 31 '22 at 21:37
  • @Mmoniem "secure" in this context means the key can't get into peoples hands. And that's simply not the case / possible when you include it in e.g. an Android / IOS / PC app because you can extract the key from those by for example downloading the .apk and decompiling it with simple tools. The only place where the software isn't available to people is the software running on some server backend and that's why you're supposed to send messages from the cloud like "Firebase *Cloud* Messaging" suggests. Google seems to take it rather seriously since they scan apps for those keys – zapl Jan 03 '23 at 23:57

0 Answers0