-->

Firebase scheduled notification in android

2020-03-25 12:54发布

问题:

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.