Where should I store my FCM server key if not on client side for security? iOS?

半腔热情 提交于 2019-12-25 02:29:29

问题


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?


回答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:

  • Sending notifications between Android devices with Firebase Database and Cloud Messaging
  • How to send device to device messages using Firebase Cloud Messaging?
  • How to send Device to device notification by using FCM without using XMPP or any other script.? Note the downvotes on the accepted answer: while this technically works (and may be what you are doing), it is not secure and puts you at a serious risk of allowing a malicious actor to send messages to your users on your behalf.


来源:https://stackoverflow.com/questions/53183533/where-should-i-store-my-fcm-server-key-if-not-on-client-side-for-security-ios

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