Skip to content
Discussion options

You must be logged in to vote

Closed as in the user swiped away the app? If so, Android doesn't close foreground services on your behalf. To make matters worse, there isn't a way to reliably check if an android app is even being closed. I do have a variable you can set that will try to shutdown the foreground service, but it unfortunately is not guaranteed to work on all flavours of Android. I don't set this as a default value since it is not the default android behaviour.

#if ANDROID
await GpsManager.StartListener(new AndroidGpsRequest
{
    ... your other settings
    StopForegroundServiceWithTask = true
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jschneiderCDS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants