LocationUpdatesForegroundService Sample not retrieving location under background and Battery Optimization

  • Thread starter Thread starter GolfPeaceMan
  • Start date Start date
G

GolfPeaceMan

Guest
I downloaded LocationUpdatesForegroundService Sample and printed location data from the OnLocationChange event. I am discovering that the sample (APP) works great and successfully write location data even while APP is in background (Screen Off) and Battery Optimization is OFF.

Unfortunately, when APP is in background (Screen OFF) and the Battery Optimization has been turned ON, then there is no location data written to output file.

Even if I put the APP in BatterySaver Optimization WhiteList, the data is not written.

I tried

intent.SetAction(Android.Provider.Settings.ActionIgnoreBatteryOptimizationSettings);

but without success

How can I get the location when the APP is running in the Background and the screen is turned OFF and BatterySaver Optimization is turned ON ?

Continue reading...
 
Back
Top