0

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?

deworde
  • 2,679
  • 5
  • 32
  • 60

1 Answers1

0

Turns out this is a bug in version 4, which causes the OS to smack firebase down for being greedy.

Follow https://github.com/invertase/react-native-firebase/issues/971 for progress.

deworde
  • 2,679
  • 5
  • 32
  • 60