Cloud Messaging in Cloud Functions: admin.messagin(…).send is not a function

不想你离开。 提交于 2019-12-01 18:20:13

change this:

return admin.messaging().send(payload);

to this:

return admin.messaging().sendToTopic(topicname,payload);

to be able to send notifications to topics.


You can do the above, or check the note below

Note:

You need to update the firebase-admin npm package, to be able to use send():

npm install firebase-admin@latest

more info here:-

https://firebase.google.com/support/release-notes/admin/node https://firebase.google.com/docs/cloud-messaging/admin/send-messages

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