Whatever device you are using, don’t blame the developers as the first thing when something goes wrong. First check your phone settings whether some background processing is not restricted on your device.
See below for general solutions that apply for various vendors.
pm uninstall --user 0 com.useless.piece.of.trash
Look through the vendor-specific phone settings and search for anything related to battery optimization or background processing. If you find it try to disable it.
Always check the following setting Phone settings > Battery & power saving > Battery usage > Ignore optimizations > Turn on to ignore battery optimization for your app.
Check if Phone settings > Apps & Notifications > Your app > Background restrictions or Background limits are not enabled for the app.
If all fails you can turn Doze mode off completely.
TURN OFF DOZE ON ANDROID 6.0 AND EARLIER
In Settings > Developer options. (If you don’t know how to enable developer options, Google should help.)
TURN OFF DOZE ON ANDROID 7+
Requires expert skills
dumpsys deviceidle disable