'Notification scheduling

I am developing an android app which is about meal subsciption. I update the entire menu(breakfast, lunch , dinner) for each day in the morning( I am using firebase). Now i want to send scheduled notification to users that is, i want to notify a user at 1pm that this is the coming menu for the lunch similarly i want to notify the user at around 8pm that this is the coming menu of dinner. What should i use to get this scheduled notification?

I had an idea in mind that when i update the database in the morning. I will send a data payload with the required scheduling time using cloud messanging and schedule the notification on the device itself. Will this work?



Solution 1:[1]

Yes, it will work, I recommend using Worker to schedule notification and take into account receiving notifications while the app is in the background, because your app should have that feature I guess.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 danPyk