Following our conversation in the question comments, I have updates about my test.
I had to stop it today, but the test length was almost a week as you can see looking at the dates. I can approve that the WorkManager
& FCM
(without high-priority) was working great for me.
What I did is - regardless of the PeriodicWorkRequest
I registered, on every FCM received, I enqueued a OneTimeWorkRequest
for the same work registered with the PeriodicWorkRequest
My conditions:
- targetSDK - 27
WorkManager
version - 1.0.0alpha04
PeriodicWorkRequest
, 15 minutes. NetworkType.CONNECTED
constraints.
com.google.android.gms:play-services-gcm:11.8.0
- Push (without high-priority) sent every 1 hour if the work didn't run
- Test devices: Galaxy S8, Huwawei p20 lite, Galaxy S7, Pixel 2. (All running Oreo)
- The app was killed after installation and I didn't open it at all during the test
The behaviour varied from device to device, but the overall behaviour was as follows:
During the first days (3 for the Galaxy S8 for example) the work ran every ~15 minutes, the rest of the days it ran every 1-5 hrs. For my purpose of background & battery efficient work, it was perfect. And it's better than once a day without the pushes as you described.