I have read a similar question on SO, however, I was not able to get the correct answer from it.
I have a system wherein we send notification to around 500 devices.<
Have you tried to use stopWithTask attribute on your service class?
If set to true, this service with be automatically stopped when the user remove a task rooted in an activity owned by the application. The default is false.
If the flag is false, there is an onTaskRemoved
callback in your Service class.
In the case you can detect the "swipe" event, and you can implement a workaround.