react-native-store-version
This module check an app's version on google playstore or ios app store.
By writing code successfully, you can make a forced update.
I've only been updating occasionally, but I'd be happy to sponsor you to keep me motivated.
https://github.com/sponsors/watanabeyu
Installation
$ npm install --save react-native-store-version
CHANGELOG
v1.4.0
- Sorry for the long wait for an update.
- fix android.ts by hussainimdad004
- use prettier
- move example to snack
v1.3.0
- if failed, throw an error.
- add result detail.
Usage
import checkVersion from 'react-native-store-version';
export default function App() {
useEffect(() => {
const init = async () => {
try {
const check = await checkVersion({
version: '1.0.0',
iosStoreURL: 'ios app store url',
androidStoreURL: 'android app store url',
country: 'jp',
});
if (check.result === 'new') {
}
} catch (e) {
console.log(e);
}
};
init();
}, []);
}
Return value
{
local: "1.0.0",
remote: "1.1.0",
result: "new",
detail: "remote > local",
}
{
message: "string",
}
result compare from a local
to remote
.
If local(1.0.0)
and remote(1.1.0)
, result is new.
Example
Check out example on snack