MinaSamir11 / react-native-store-review

Rate on App Store directly in your React Native app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-store-review

This module exposes the native iOS APIs to ask the user to rate the app in the iOS App Store directly from within the app (requires iOS >= 10.3).

Rating Dialog

Installation

$ yarn add react-native-store-review

Mostly automatic installation

$ react-native link react-native-store-review

Manual installation

  1. In Xcode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-store-review and add RNStoreReview.xcodeproj
  3. In Xcode, in the project navigator, select your project. Add libRNStoreReview.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

Using CocoaPods

Add the following to your Podfile and run pod install:

pod 'RNStoreReview', :path => '../node_modules/react-native-store-review/ios'

Usage

import * as StoreReview from 'react-native-store-review';

// This API is only available on iOS 10.3 or later
if (StoreReview.isAvailable) {
  StoreReview.requestReview();
}

Notes

StoreReview.isAvailable will not return false if Apple's limit for showing the store rating has been reached. It simply returns if the API is available. You will have to keep track of that by yourself.

If you are using this library, you might want to know how the underlying SKStoreReviewController is working: first things first, here is the doc.

And having the API Reference might not be enough (the API has some arbitrary limits), that's why we recommend you to read this guide.

The short story behind this SKStoreReviewController is that Apple does not want apps to spam users with review requests. Therefore you're able to show this dialog only few times per year. It means that you need to be pretty sure when you want to show it and probably ask the user if he wants to review the app in a first place (before showing this costly dialog).

Another interesting point is that the dialog is not showing while testing with TestFlight but will be working normally once in production (source).

About

Rate on App Store directly in your React Native app

License:MIT License


Languages

Language:Objective-C 41.6%Language:JavaScript 28.7%Language:Python 13.5%Language:Java 10.8%Language:Ruby 5.4%