# rn-update-version

> Download and update react-native app on android & iOS, customize your own UI.

Latest version **0.3.0** (published 2022-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-update-version
pnpm add rn-update-version
yarn add rn-update-version
bun add rn-update-version
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2022-10-11 |
| First published | 2022-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 487.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | limoer |
| Maintainers | limoer |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/rn-update-version
- Repository: https://github.com/Limoer96/react-native-update-version
- Homepage: https://github.com/Limoer96/react-native-update-version#readme
- Issues: https://github.com/Limoer96/react-native-update-version/issues
- npm.io page: https://npm.io/package/rn-update-version

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2022-10-11
- 0.2.2 — 2022-09-28
- 0.2.1 — 2022-09-27
- 0.2.0 — 2022-09-27
- 0.1.0 — 2022-09-26

## 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)

---
_Source: https://npm.io/package/rn-update-version · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
