Reputation: 673
I am working on chat application using firestore on android. My initial plan was to listen to message collection and store the snapshot and subsequent changes locally in roomdb.
This is to avoid showing a progress bar until I process the snapshot. i.e when user go to the Chat view, it will take messages from RoomDB and show it to the user until firestore snapshot is received.
Is this correct design approach? can I use offline data approach instead? (https://firebase.google.com/docs/firestore/manage-data/enable-offline)
What is the impact on device storage in each approach.
Upvotes: 2
Views: 2362
Reputation: 599051
Cloud Firestore natively stores the data locally already, which seems to accomplish what you need without you have to write any code for it. Read the documentation on Firestore's offline features to learn more about it.
Upvotes: 1