@platformbuilders/use-rating
v0.3.10-beta.1
Published
[![Build Status][check-badge]][workflows] [![codecov][codecov]](https://codecov.io/gh/platformbuilders/use-rating) [![npm][npm-badge]][npm] [![MIT][license-badge]][license]
Downloads
15
Readme
@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());
}
}