# @platformbuilders/use-rating

> [![Build Status][check-badge]][workflows] [![codecov][codecov]](https://codecov.io/gh/platformbuilders/use-rating) [![npm][npm-badge]][npm] [![MIT][license-badge]][license]

Latest version **0.3.10-beta.1** (published 2023-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @platformbuilders/use-rating
pnpm add @platformbuilders/use-rating
yarn add @platformbuilders/use-rating
bun add @platformbuilders/use-rating
```

## 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.10-beta.1 |
| Published | 2023-07-06 |
| First published | 2020-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 2 |
| Unpacked size | 64.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Platform Builders |
| Maintainers | luancteixeira, dev-builders |

## Links

- npm: https://www.npmjs.com/package/@platformbuilders/use-rating
- Repository: https://github.com/platformbuilders/use-rating
- Homepage: https://github.com/platformbuilders/use-rating#readme
- Issues: https://github.com/platformbuilders/use-rating/issues
- npm.io page: https://npm.io/package/@platformbuilders/use-rating

## Dependencies (2)

- [react-native-version-number](https://npm.io/package/react-native-version-number.md) 0.3.6
- [@react-native-async-storage/async-storage](https://npm.io/package/@react-native-async-storage/async-storage.md) ^1.18.1

## Recent versions

- 0.3.10-beta.1 (latest) — 2023-07-06
- 0.3.9 — 2023-05-29
- 0.3.8 — 2023-04-17
- 0.3.7 — 2023-03-15
- 0.3.6 — 2022-12-26
- 0.3.5 — 2022-12-26
- 0.3.4 — 2022-12-26
- 0.3.3 — 2022-12-08
- 0.3.2 — 2022-10-14
- 0.3.1 — 2022-10-11
- 0.3.0 — 2022-10-04
- 0.2.0 — 2022-08-18
- 0.1.5 — 2022-03-31
- 0.1.4 — 2022-03-31
- 0.1.3 — 2022-03-16
- … 4 more at https://npm.io/package/@platformbuilders/use-rating/versions

## README

[![Build Status][check-badge]][workflows]
[![codecov][codecov]](https://codecov.io/gh/platformbuilders/use-rating)
[![npm][npm-badge]][npm]
[![MIT][license-badge]][license]

[npm-badge]: https://img.shields.io/npm/v/@platformbuilders/use-rating.svg
[npm]: https://www.npmjs.com/package/@platformbuilders/use-rating
[license-badge]: https://img.shields.io/dub/l/vibe-d.svg
[license]: https://raw.githubusercontent.com/platformbuilders/use-rating/master/LICENSE.md
[workflows]: https://github.com/platformbuilders/use-rating/actions
[check-badge]: https://github.com/platformbuilders/use-rating/workflows/check/badge.svg
[codecov]: https://codecov.io/gh/platformbuilders/use-rating/branch/master/graph/badge.svg

# @platformbuilders/use-rating

Easily check if user should be asked about rating based on number of uses and last rated version.

## Install

```
yarn add react-native-store-review @platformbuilders/use-rating
```

## Usage

iOS users will be inapp prompted to rate (1 to 5 stars) your app. Android users will be redirected to app's page on Play Store.

```
import { useRating } from '@platformbuilders/use-rating';

const { shouldRate, askRate } = useRating(DeviceInfo.getVersion());

const checkRating = async () => {
  const minUsageNumber = 3;
  const shouldAsk = await shouldRate(minUsageNumber);
  if (shouldAsk) {
    askRate(DeviceInfo.getBundleId());
  }
}
```

---
_Source: https://npm.io/package/@platformbuilders/use-rating · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
