Integrate Firebase Database with FCM

2019-06-13 18:33发布

Is there a way to integrate the Firebase real time database with the newly introduced Firebase Cloud Messaging services ?
I am building an app which uses the the Firebase realtime database for storing data. I want to notify my users using push notifications for every new insert in the database. I came across tutorials which teach you how to use FCM, but most of them require you to set up your own server for storing tokens. Is there a serverless way of integrating Firebase DB with FCM ?

1条回答
等我变得足够好
2楼-- · 2019-06-13 19:22

Sending messages to devices based on inserts into the Firebase Database will require you to run a trusted process, typically on an app server that you control. This trusted process listens to the database changes and then calls Firebase Cloud Messaging to send the messages.

For an example of how to send messaging from a node.js script, see my answer here: How to send Firebase Cloud Messaging from a node server?

查看更多
登录 后发表回答