Does firebase have a native way to check if the app has the latest data on the second load?
Here is the app workflow.
- When the app loads I get data from firebase and display it to the user.
Data is also stored locally to be displayed later.
The user closes the app and the reopens it sometime in the future.
How do I check if Firebase had new data and get it only if it has?
What I am doing is that I am storing a TimeStamp on my device and on the database. On each app load I check if the TimeStamp matches.
If it does then I display old local data otherwise make call to get latest.
Is this the correct way?
Basically what I am asking is I want to display locally stored data, but if firebase has new data then I want to get it and display that.