Ionic - background tasks + GPS

I’m writing an Android app where one of the features is similar to Strava – a training tracker. Users can start a training session, and I track their GPS position as a background task. At the end of the session, I analyze their route, speed, etc.

My activities usually last 4–8 hours, and the process runs in the background the entire time. I wonder how well Ionic can handle this. Can I achieve good performance (so system won’t kill my app) with Ionic? Anyone have experience on that?

Have you read the docs? your answers are there: Background Runner Capacitor Plugin API | Capacitor Documentation

Thanks for that, maybe you know if there are any plans to support such a task in future?

For Android, it sounds like you are needing an Android Foreground Service. Capawesome has a simple plugin for it - Capacitor Android Foreground Service Plugin - Capawesome. If that doesn’t work, it’s not too hard to create your own as a local Capacitor plugin.

For iOS, I am not that familiar. For an audio plugin I created, I just had to check a box in XCode saying the app requires background mode.