Firebase Offline Storage Advanced - Manual Sync and Progress Information

后端 未结 1 1569
無奈伤痛
無奈伤痛 2021-02-07 13:44

I have an App where a main Feature is \"Offline Usage\".

We generate a SQLite-Database on our Server what we provide on an API for download. Each time the Database has c

相关标签:
1条回答
  • Can I download the entire Firebase Database for Offline Usage (Not in an App-Cache, in a persistent Storage)?

    Yes you can do this by setting disk persistence to true. You just need to reference the highest level in the database and firebase will return all child nodes. https://firebase.google.com/docs/database/android/offline-capabilities

    Can I track the Progress of the Offline Sync and give the User the option if he want's to sync now or later?

    I have never tried to show the actual progress, however when you retrieve data from firebase there is always the onDataChange method that gets called when you have succesfully retrieved data. https://firebase.google.com/docs/database/android/retrieve-data#read_data_once

    Can I restrict the Sync to WIFI only?

    I have not seen this option in the Firebase documentation, however I do not believe it would be very difficult to implement

    Can I deliver a Bundle Database - that after installing the App I can already query offline-Firebase Data?

    You would need to grab data from Firebase as soon as the App is installed. You could also in theory when the app is first run try to write to the Firebase database without any network and then this data could be available locally, however you would need to be careful as when the user gets a network connection then this data might overwrite the data in the Firebase database. How do I cache Firebase data for offline usage?

    0 讨论(0)
提交回复
热议问题