https://github.com/limoer96/react-native-update-version
Download and update react-native app on android & iOS, customize your own UI.
https://github.com/limoer96/react-native-update-version
android kotlin kotlin-android react-native
Last synced: 8 months ago
JSON representation
Download and update react-native app on android & iOS, customize your own UI.
- Host: GitHub
- URL: https://github.com/limoer96/react-native-update-version
- Owner: Limoer96
- License: mit
- Created: 2022-09-23T08:37:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-11T06:41:37.000Z (over 3 years ago)
- Last Synced: 2025-09-03T22:58:19.084Z (10 months ago)
- Topics: android, kotlin, kotlin-android, react-native
- Language: Java
- Homepage:
- Size: 514 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# rn-update-version
Download and update react-native app on android & iOS, customize your own UI.
## Installation
```sh
npm install rn-update-version
# or
yarn add rn-update-version
```
### Setup
> In Xcode `info.plist` add `LSApplicationQueriesSchemes` and set value as array type included `itms-apps` to open `AppStore`.
## Usage
```tsx
import UpdateVersion from 'rn-update-version';
// ...
const [percent, setPercent] = React.useState(0);
const [errorMessage, setErrorMessage] = React.useState('');
// for Android
UpdateVersion.update({ url: MOCK_URL });
// for iOS
UpdateVersion.update({ appleId: '444934666' });
// android only
UpdateVersion.cancel();
// android only
useEffect(() => {
const remove = UpdateVersion.listen(
(payload) => {
setPercent(payload.percent);
},
(info) => {
setErrorMessage(info.message!);
}
);
return remove;
}, []);
```
> or use `useUpdateVersion` hook
```tsx
import { useUpdateVersion } from 'rn-update-version';
// ...
const { update, cancel, progress, errorMsg } = useUpdateVersion();
```
## API
### update(config: UpdateConfig)
> Start update action, donwload and install app.
### cancel
> Cancel the update process.
### listen(onProgress: (payload: ProgressPayload) => void,onError?: (payload: ErrorPayload) => void)
> Event listeners during the update process.
### useUpdateVersion
> React hooks for the update process.
## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT
---
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)