nazrinharris / farmhub

App to find out prices of farm produce at a specific location in Malaysia
3 stars 0 forks source link

Local version and proper version refreshing #199

Closed nazrinharris closed 1 year ago

nazrinharris commented 1 year ago

Basically the only time the app updates the user's claim is during authentication, which is okay, but there should also be checks done more often. This PR will have the app check if the custom claim needs to be added by comparing against the locally stored version. So, if the version from PackageInfo is different from the locally stored version, updateAppVersionClaim will be called to update the claim.

On app startup, getFarmhubConfig() should be called to activate the remote config retrieval. TBF, I'm not sure if this is actually needed, but I decided to do it anyway.

Also, there needs to be fallback if this happens during offline. Which will be much easier to handle when localAppVersion, minimumAppVersion and latestAppVersion is stored locally.