Firebase scheduled notification in android

社会主义新天地 提交于 2020-02-14 13:23:26

问题


I'm developing an android app using firebase, this app should push notifications twice a day by hours user should set in app settings.

I saw a similar question was asked at least 2 years ago, but no answer, maybe now there is an option to do it.

Is there anyway I can achieve this using Firebase ? If no, how can I achieve it ?


回答1:


You can schedule sending notifications from the Firebase console. But that is limited to notifications you manually enter. There is no way to schedule "twice a day" delivery, nor is there an API to schedule the delivery programmatically.

This means that you'll have to write code to implement this yourself. One way to do this would be to use the Firebase Cloud Messaging API to send the messages, use the Firebase Realtime Database (or Cloud Firestore) to store information on when and where to send the messages, and then invoke a Cloud Function on a schedule to read the information from the database and call the FCM API.



来源:https://stackoverflow.com/questions/49588864/firebase-scheduled-notification-in-android

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