0

I have been using FCM to deliver notifications that uses POST requests that require FCMs server key. How do I still send notifications without having the fcm server key client side for security reasons?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    Store it in your server. Let your client device so a request to your server which will then forward the request to fcm. – kks21199 Nov 07 '18 at 04:28

1 Answers1

1

There is no way to securely send messages from one client device to another client device with FCM. You always need a trusted environment (such as a server that you control, your own development machine, or Cloud Functions) to do that, where you can enforce whatever "who can send to whom" rules you want.

For more on this, see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Frank.Thank you for the quick and thorough response. I will look into hosting script through Cloud Functions to achieve this level of security. – Landon Carr Nov 07 '18 at 06:04