Skip to content
Advertisement

How can i make the app work offline with Firebase database

My app gets the data while its connected to internet but I want the app to get the data offline from cache. Please help I’m new to Firebase.

Advertisement

Answer

Simply activate offline persistens as specified in the official documentation:

Firebase applications work even if your app temporarily loses its network connection. You can enable disk persistence with just one line of code:

FirebaseDatabase.getInstance().setPersistenceEnabled(true);
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement