Look for any vendor-specific battery saver on your device and ideally uninstall if possible, else disable the battery saver.
Look through the vendor-specific phone settings and search for anything related to battery optimisation or background processing. If you any, try to disable them.
Android 6+
Always check the following setting Phone settings > Battery & power saving > Battery usage > Ignore optimizations > Turn on to ignore battery optimisation for your apps.
Android 8+
Check if Phone settings > Apps & Notifications > Your app > Background restrictions or Background limits are set to not enabled for the app or turn them off if they are on.
If all fails you can turn Doze mode off completely.