Check if the user is running the latest version of the app
npm install react-native-check-version

---
An easy way to check if there's an update available for the current app in the App Store or Google Play.
Note that you need react-native-device-info to be
installed for this library to function as expected, or you need to manually supply the bundleId andcurrentVersion values in the options object.
```
yarn add react-native-check-version react-native-device-info
Use the checkVersion method to get information:
`js
import { checkVersion } from "react-native-check-version";
const version = await checkVersion();
console.log("Got version info:", version);
if (version.needsUpdate) {
console.log(App has a ${version.updateType} update pending.);`
}
checkVersion() accepts an _optional_ options object, which may contain the following keys:
- string platform: platform to check for, defaults to React Native's Platform.OScountry
- string : App Store specific country, defaults to usbundleId
- string : bundle identifier to check, defaults to the value retrieved using react-native-device-infocurrentVersion
- string : version to check against, defaults to the currently installed version
checkVersion() returns a Promise, which when resolved will return an object with the following properties:
- string version: latest version number of the appreleased
- string : (iOS only) ISO 8601 release date of that versionurl
- string : download URL for the latest versionnotes
- string : release notes of latest versionneedsUpdate
- boolean : whether the latest version number is higher than the currently installed oneupdateType
- string : major, minor or patch, based on how big the difference is between the currently installed
version and the available version
- v1.1.0: Use built-in fetch rather than Axios library.v1.0.18
- : Update headers for Google Play HTTP request.v1.0.14
- : Updated Android logic to use new Google Play endpoints.v1.0.13
- : Added a try-catch within the main checkVersion function to prevent error responses from the HTTP requestsv1.0.12`: Replaced the custom backend used
to throw errors.
-
previously by doing calls directly within the app. Please note Google Play has updated their web pages, making older
versions not functional.
This library is developed by Includable, a creative app development agency.
- Thomas Schoffelen
---