react-native-in-app-updates
Version:
Ensure your users always stay up-to-date with the latest version of your app. This library offers seamless in-app update functionality for React Native, currently available only for Android.
61 lines (41 loc) • 1.34 kB
Markdown
in-app-updates** is a lightweight and simple-to-use library for implementing Android in-app updates. Keep your app users up-to-date seamlessly with minimal effort.
- Lightweight and easy to integrate.
- Supports Android in-app update flows.
- Flexible update options for a tailored user experience.
Install the package using npm:
```sh
npm install react-native-in-app-updates
```
To check for updates, use the following example code:
```javascript
import { useEffect } from 'react';
import { checkForUpdate, UpdateFlow } from 'react-native-in-app-updates';
useEffect(() => {
getData();
}, []);
async function getData() {
try {
await checkForUpdate(UpdateFlow.FLEXIBLE);
} catch (e) {
// Handle error
}
}
```
You can choose between two update flows:
- **Flexible:** Allows users to continue using the app while the update downloads.
```javascript
await checkForUpdate(UpdateFlow.FLEXIBLE);
```
- **Immediate:** Forces users to update the app before they can continue using it.
```javascript
await checkForUpdate(UpdateFlow.IMMEDIATE);
```
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
MIT
**react-native-