Firebase Offline Real-Time Troubleshoot Database

I am using Firebase Realtime Database in my application. It works very well, and I'm quite happy with that. But recently, I came across a regional case, due to which some of my users are losing their data.

SCENARIO # 1

The user logs in to the application (Firebase Authentication) with an Internet connection on and adds some data to the database.

The user subscribes to the Internet connection and logs in again, and the previously saved data is there, as expected. An internet connection is available and data is synchronized with the server.

SCENARIO # 2

Now the user disconnects his Internet connection. Add some more data to the database and exit the application when the Internet connection is disconnected .

Now the user again turns on his Internet connection and subscribes to the application in the same way as indicated above.

Now the user does not see any data that was added when the application was offline . It setPersistenceEnabled(true)works fine for me in normal situations.

Problem

The problem is that persistence fails when the user is offline, adds some data to the database (which does not synchronize with the server because there is no internet) and is issued offline, and then signs up later.

, - . ? Firebase Database ? , - ?

+4
1

.

Firebase https://firebase.google.com/docs/database/android/offline-capabilities

... Firebase Authentication, . , , , - . ..

, , , .

.

+1

Source: https://habr.com/ru/post/1661307/


All Articles