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).
$ yarn add react-native-store-review
$ react-native link react-native-store-review
- In Xcode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-store-review
and addRNStoreReview.xcodeproj
- In Xcode, in the project navigator, select your project. Add
libRNStoreReview.a
to your project'sBuild Phases
➜Link Binary With Libraries
- 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'
import * as StoreReview from 'react-native-store-review';
// This API is only available on iOS 10.3 or later
if (StoreReview.isAvailable) {
StoreReview.requestReview();
}
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).