sp-react-native-in-app-updates
sp-react-native-in-app-updates copied to clipboard
result.storeVersion shows version code instead of app versions
Greetings! At our company, we are currently working on an application that utilizes the in-app update functionality. However, we have encountered an issue where the result.storeversion is returning the version code (e.g. 7) instead of the app version (e.g. 1.0.6) which we were expecting. Is there a solution or method to retrieve the app version instead? We appreciate any suggestions you may have.
@rahulg1254 Hi! I'm not an expert but this library (as you probably already know) uses the native system capabilities so for android AppUpdateManager doesn't return app version it returns version code only. Unfortunately.
https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#availableVersionCode()
Now I'm in the same situation and I choose between a working with a code version or a using our server to keep a app version. Both of these options have their pros and cons. The second one is the immediate lack of automation, but the first one it isn't a work with semantic version. And so on ...
I think you have already thought about these options yourself. So you can share your experience in this if you wont 😄.
@SudoPlz Loving this library so far as this is one of its kind ! Was just wondering.. is there any way I could get the update priority which the play core service returns ? Only then can I decide if an update is immediate or flexible.
Here's the reference to the updatePriority() docs : https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#updatePriority()
hey @mritul, thanks for your kind words.
We do expose that here https://github.com/SudoPlz/sp-react-native-in-app-updates/blob/36f2e9b0da69c88a945010d43f3d1035a6e62810/android/src/main/java/com/sudoplz/rninappupdates/SpReactNativeInAppUpdatesModule.java#L106
which is exposed in a field called other
in the checkNeedsUpdate
response.
So essentially you should be able to do:
const response = await checkNeedsUpdate(...)
response.other. updatePriority
should work.
Right ! Thanks for the prompt response ✌️
@SudoPlz Also is there any way I could achieve the full screen update. Because currently startUpdate redirects to the play store.