I have updated the app to now use WorkManagers OneTimeWorkRequest, which will make scheduling notifications more reliable in the future. It uses Firebase JobDispatcher on API 23+, and AlarmManager before that.
We will no longer need to use services or Broadcast Receivers as Android does all the work for us, and even takes care of device reboots and app force stops.
I have used about 90% of the code from BedtimeNotificationReceiver.java, and used it in a class that extends Worker. I have replaced the calls to this receiver with calls to a Notification Utility class that creates a OneTimeWorkRequest.
I have updated the app to now use
WorkManager
sOneTimeWorkRequest
, which will make scheduling notifications more reliable in the future. It uses Firebase JobDispatcher on API 23+, andAlarmManager
before that.We will no longer need to use services or Broadcast Receivers as Android does all the work for us, and even takes care of device reboots and app force stops.
I have used about 90% of the code from
BedtimeNotificationReceiver.java
, and used it in a class that extendsWorker
. I have replaced the calls to this receiver with calls to a Notification Utility class that creates aOneTimeWorkRequest
.This PR should fix #11