I have an iOS App (in objective-c). I'm using [ref observeEventType:FIRDataEventTypeChildAdded withBlock:...]. I'm using a particular node as a mailbox, the observer block collects the "mail" and deletes it. So, the user's "mailbox" should stay empty while the app has an Internet connection.
This is working just fine most of the time. However, after "a while", the Firebase observer stops observing (block never gets called). I'm only adding the one observer in the entire app and it is protected from any double-observing by checking a flag inside of a thread-safe block. I've tried removing the observer and re-adding it when the app goes from background to foreground; but that didn't resolve the issue. So, I've just now added code to log out of Firebase and log back in when the app goes to foreground. I don't yet know if this will work, but I'm wondering why I'm even having to go though these gyrations (not to mention this adds a several second delay when starting the app before Firebase can start observing again).
Is this a common issue that folks just cope with? I'm using Firebase for authentication, FCM, and the one observer. The app is working perfectly in all other aspects, it's just the Firebase observer not firing.
Any ideas would be great, thanks!
-Dave