ekasetiawans / flutter_background_service

266 stars 188 forks source link

Foreground is not working when screen is off #280

Open johnray016 opened 1 year ago

johnray016 commented 1 year ago

I am workinf on a project where the app gets the users location. Everything works fine when the phone is active. But when I lock my phone (screen off) the foreground stops getting the location.

Any idea how to solve this? Thank you!

daviddagan commented 1 year ago

try adding location always permission

johnray016 commented 1 year ago

Actually I already tested the app and the foreground task was stop when the app is in Doze Mode. When I try adb shell dumpsys deviceidle force-idle the foreground stops sending data. Then when I try adb shell dumpsys deviceidle unforce the foreground task is back so it is something about Doze Mode.

StarAndSun commented 1 year ago

Has this problem been solved? I had the same problem

abolfazlrezaeiv commented 4 days ago

The same problem When the app is paused the background more stops