3 ms·
There is a way to detect it but it's hacky. You need to use fcm xmpp to send data push notifications with delivery receipts and also send an acknowledgement fro
by me551ah 8y ago
There is a way to detect it but it's hacky. You need to use fcm xmpp to send data push notifications with delivery receipts and also send an acknowledgement from the apps background service. Devices where you don't get the app ack have an app which is force killed
Details outlined here : hackernoon.com/notifications-in-android-are-horribly-broken-b8dbec63f48a
- Izkata 8y agoThat sounds way over-complicated. Why not just keep a flag in the database that's updated during the Activity lifecycle?
- me551ah 8y agoSorry, I didn't understand. We need a service side service to keep track of ack's that we received from the device. I am not able to understand how a db flag would help.
- Izkata 8y agoIf all you need is to detect it on the next boot to notify the user, as the prior comment said, then for example: onCreate - check "running" flag, then set to true onDestroy - set flag to "ended" If onCreate saw the flag was already "running" before it was set, then you have a crash to recover from or a kill to notify the user about.