Keep tracking user driving sessions when the app is killed.

I want a solution to keep tracking the user once he started in driving state until parking.

I tried many solutions like use significant location changes, and silent push notifications and background tasks, but no one of them worked as expected.

I need when user started in driving the app be active until the user parked his car.

I'm using CoreMotion and CoreLocation.

The challenge is when the app is not active like killed or suspended.

So, how to do this? is this possible or not?

Answered by Engineer in 826580022

To keep tracking location after the app has been killed, you will want to use the new CoreLocation API CLBackgroundActivitySession.

The sample project Adopting live updates in Core Location demonstrates its use.

You would also want to watch Discover streamlined location updates and What’s new in location authorization to get a good understanding of the new APIs.


Argun Tekant /  DTS Engineer / Core Technologies

To keep tracking location after the app has been killed, you will want to use the new CoreLocation API CLBackgroundActivitySession.

The sample project Adopting live updates in Core Location demonstrates its use.

You would also want to watch Discover streamlined location updates and What’s new in location authorization to get a good understanding of the new APIs.


Argun Tekant /  DTS Engineer / Core Technologies

Keep tracking user driving sessions when the app is killed.
 
 
Q