Ahmed Rajab
Ahmed Rajab

Reputation: 701

Does firebase realtime database persistence sync data after device reboot

I have searched everywhere but couldn't find an answer to this question, if firebase persistence is enabled, the application continues to sync data after the device regains connection if it was offline, but my question is that if the device is rebooted does the firebase sync data automatticaly after it gains connection or I should use a broadcast receiver to detect system reboot in order to make it works.....

Upvotes: 1

Views: 486

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598728

The Firebase Realtime Database has two types of persistence:

  1. In memory persistence. This type is turned on by default, and allows the app to continue working when you briefly lose internet connectivity. A simple way to think of this is "tunnel mode" - the app continue working when you go through a (short) tunnel.
  2. Disk persistence. This type of persistence must be turned on explicitly by your code, and (as its name says) it means that recently listened data (as well as any pending writes from the app to the database) are persisted to disk. The data in this cache survives app restarts, and phone reboots.

Upvotes: 5

Related Questions