FCM Security: Prevent multiple senders from pushing notifications to all devices?

前端 未结 2 1392
孤城傲影
孤城傲影 2020-12-15 15:01

As part of our solution, we want to deploy an FCM \"app server\" at each of our customer sites. Each customer site has their own users with their own devices using our app.

2条回答
  •  暖寄归人
    2020-12-15 15:30

    There is no way to restrict a server key to only allow certain topics/devices/etc.

    I would consider using Cloud Functions for Firebase to solve this a different way. You could build an HTTPS function that took per-site authorization tokens (by any means you deem fit) and then that function calls through to Firebase Cloud Messaging to actually send the push notifications.

    This way, you have complete control over what kinds of push notifications can be sent by the "client" sites, and you don't have to worry about cascading security problems in the event a client site gets compromised.

提交回复
热议问题