0

Is it possible to force a observeSingleEvent from online by skipping the cache?

I have Database.database().isPersistenceEnabled = true and keepSynced = true. I generally want to use the cache but for this one task I want to force the data to be fetched from online.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Oskar Gusgård
  • 457
  • 7
  • 20
  • Using disk persistence and `observeSingleEvent` don't mix well. If you want the latest version, you should use regular `observe`. See my longer explanation here: https://stackoverflow.com/questions/34486417/firebase-offline-capabilities-and-addlistenerforsinglevalueevent/34487195#34487195 – Frank van Puffelen Jul 30 '18 at 14:37
  • Thank you so much Frank. Is there no possibility to add any parameters to the observeSingleEvent function to ignore the cached data, or to invoke something like ingnoreCache = true? – Oskar Gusgård Jul 31 '18 at 06:34
  • Nope. If you want the latest, find a way to use a regular observer, or don't use disk persistence/keep synced. – Frank van Puffelen Jul 31 '18 at 13:04
  • Thank you Frank! – Oskar Gusgård Aug 01 '18 at 13:57

0 Answers0