0

Tried both worker Manager and AlaramService to broadcast and execute a service at a given time[1am] daily to fetch the location of device and execute a restcall, though the app instance is terminated.

->But devices running android 8 and above , this solutions are not working. ->OnWork is called but the service is not executing and there is no errors in logCat. if implemented with AlarmService, onReceive is getting called but service not getting called in onRecieve (no errors in logcat)

Is there any other alternate solution to get the location data periodically and execute a post request from device , ready to change the flow like pushing notification from server to the device instead of relying on WorkerManager or alaramService.

thanks

user961524
  • 537
  • 1
  • 7
  • 19

1 Answers1

1

The problem you have is to keep your service running in the background, there is workaround mentioned in below link,

https://stackoverflow.com/a/58162451/7579041

above link is useful for Stock ROM & Custom ROM Devices like OnePlus, OPPO, VIVO, etc

I hope this will help you out

Amin Pinjari
  • 2,129
  • 3
  • 25
  • 53