aranja/rakning-c19-app

Notify user in the background if something is interfering with location tracking

Opened this issue · 3 comments

There are a few things that can cause tracking to fail without the user perhaps realizing it.

This is especially tricky on Android since it has a foreground service and notification which indicates that everything is working, even though something is broken.

Maybe the best solution is to create a scheduled task that runs every few days and checks for issues. If an issue is detected, it could post a local notification, telling the user to open the app to restart tracking.

It can check if the app still has location access and if location services are turned on. It can also check if there are any new location updates in the previous X hours.

By checking on recent location updates, this could catch and address #44

This could be more difficult to implement on iOS. As I understand it, scheduled tasks only run when iOS decides it should. And it only runs scheduled tasks for apps that the user is actively using.

Maybe background location apps can run scheduled tasks more often, or we can use local notifications somehow.

Another idea is to make the background location process ping the server every few hours.

The server can track the timestamps of the latest ping, and send push notifications to those devices that haven't pinged for some time.