If I get a push notification on iOS, I want to pull some related data from the Firebase database in the background, so my user can read their articles on the train.
I'm getting the appropriate onDisplayNotification
event, and it's reliably triggering, but when I query the database, it doesn't load the relevant data until the app is foregrounded, by which time the user may be offline.
As I understand it, this is a deliberate aspect of react-native-firebase
to prevent the app from consuming a potentially huge amount of resources in the background of the application.
So how can I retrieve entries from firebase.database() when my app is backgrounded?