Firebase SDK, offline data storage with the ability to synchronize later

When using Firebase in an iOS application, I would like to give users the ability to synchronize their data in the Firebase cloud or just keep everything local. I saw that Firebase introduced an option in its SDK for going offline and for synchronizing data on the Internet, but I'm not sure about the intent of this feature.

//Keep data local. [Firebase defaultConfig].persistenceEnabled = YES; self.firebase = [[Firebase alloc] initWithUrl:kFirechatNS]; [Firebase goOffline]; 

From the documentation, it seems that goOffline () mode and offline mode as a whole are designed to handle time periods when the device is offline, and synchronize data back to the cloud as soon as the device is online again. Will Firebase be able to handle the "offline offline" scenario? Or would it force Firebase to go to a “permanent offline” lead base to simply accumulate more and more “metadata” for cloud synchronization never seen in the future? Or discard old data at some point? Or end up offline cache space when the maximum cache size is reached?

+6
source share
1 answer

I got a response from Firebase support:

While you can use goOffline () to force disconnect the client offline, performance will degrade over time. Firebase clients will post interim state changes instead of updating the saved state, as the server does.

+5
source

All Articles