I'm trying to track when a user's app is about to terminate and send something to firebase when it happens. I looked through the Offline Capabilities documentation and tried using ".info/connected"
as well as .onDisconnectSetValue()
.
I've had success with .onDisconnectSetValue()
, but if the iPhone's side button is pressed and the iPhone goes to sleep, it fires and says the user is inactive (and I can't set another value until the user brings the app to the foreground again).
I tried moving .onDisconnectSetValue()
to applicationWillTerminate() so it only catches terminations but it doesn't fire when I close the app (I assume because it can't in time)
Is there anything with Firebase that could set a value with the specific instance of the user closing the app?