Create daily push notification using Firebase Cloud Messaging

 ̄綄美尐妖づ 提交于 2021-01-26 03:56:11

问题


In the Firebase console we can set a specific time and date when will our notification will be push. But is there a way that we can set it daily? For example it will send every Monday, Wednesday and Friday or everyday?


回答1:


Push campaigns with Firebase Notifications can be sent now or later (scheduled).

You could probably switch to Firebase Cloud Messaging, use their HTTP API and then build a cron script to trigger your notifications automatically on these days.

Or switch to a more mature product like Parse Server, Batch.com or anything else as they usually provide that daily/weekly/monthly recurring push notifications feature.




回答2:


Recurring messages are available in FCM now. May be helpful to someone.




回答3:


If you want to schedule functions to run at specified times, use functions.pubsub.schedule().onRun() This convenience method creates a Google Cloud Pub/Sub topic and uses Google Cloud Scheduler to trigger events on that topic, ensuring that your function runs on the desired schedule.

https://firebase.google.com/docs/functions/schedule-functions



来源:https://stackoverflow.com/questions/37382189/create-daily-push-notification-using-firebase-cloud-messaging

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