Keep an iOS app alive for car trip detection

422 Views Asked by At

I am trying to develop an app, running in the background, that will record the trip of car drivers, using the GPS of their iPhone (and accelerometer). I have implemented a trip detection system using the iPhone sensors, and it detects fine the start and the end of a trip, without having the driver to manually start and stop the trip on my app.

The issues that I am struggling to overcome are twofold:

  • The first issue to overcome is keeping the app alive in the background, because it seems that iOS kills background apps whenever the computing power/memory is needed for other foreground apps. And once the app is killed I have no way to "revive" the app, to that a current trip continues to be recorded, or the trip detection system is kept functioning.

  • The second issue is that, even if I somehow find a way to keep an app alive in the background, then if the user reboots his iPhone, then the app will definitely be killed and the only way my background service in my app is "revived" is when the user manually start my app back.

Is there any way to overcome such issues ?

NOTE: I have thought of using an iBeacon, but even this will only trigger an event which will "revive" the app, but only allows 30 seconds (or 120 seconds using some settings) for any processing, which will not be covering the entire trip time for GPS recordings. Unless there is a workaround using iBeacon which I do know about.

EDIT: The frequency ofGPS needed is 1 per second. And for Accelerometer it is ~6 times per second, in each direction (X, Y and Z).

0

There are 0 best solutions below