Firestore listener killed when app goes in background for a long time
问题 In my app I'm listening for a Firestore query whenever the user signs in. After the app goes in background for some time, the listener gets cancelled and the client doesn't get notified of any new changes. How do I know if a listener has been cancelled by the SDK? What's the proper way of handling this? 回答1: On most operating system this is done automatically by the system itself, in order to preserve battery life. Whether it is possible to detect this situation, and how, depends on the OS.