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.
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
andlatestAppVersion
is stored locally.