Is there any way to detect when my app get killed?

Currently I’m using Ionic v6 with a Background Geolocation Plugin, in my main page I have a toggle with online/offline, to start the tracking the user needs to toggle on and to stop toggle off, this info I store in firebase, when user kills the app he stop tracking but I need a wat to toggle this status to offline again

No, there is no way to detect when your app is killed.