Gathering detailed insights and metrics for react-native-rate
Gathering detailed insights and metrics for react-native-rate
Gathering detailed insights and metrics for react-native-rate
Gathering detailed insights and metrics for react-native-rate
react-native-rate-app
React Native module for In App Rating on Android and iOS
react-native-store-review
Rate on App Store or Google Play directly in your React Native app
react-native-in-app-review
react native in app review, to rate on Play store, App Store, Generally, the in-app review flow (see figure 1 for play store, figure 2 for ios) can be triggered at any time throughout the user journey of your app. During the flow, the user has the ability
app-upgrade-react-native-rate-sdk
SDK to ask user to rate app.
Send your app users to Apple App Store, Google Play, Amazon, or other using the newest APIs
npm install react-native-rate
Typescript
Module System
Node Version
NPM Version
99.4
Supply Chain
99.5
Quality
76.2
Maintenance
100
Vulnerability
100
License
Objective-C (40.93%)
Java (31.46%)
JavaScript (22.21%)
Ruby (5.4%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
10,941,218
Last Day
994
Last Week
42,765
Last Month
176,485
Last Year
2,196,823
662 Stars
143 Commits
101 Forks
9 Watchers
3 Branches
28 Contributors
Updated on Feb 06, 2025
Minified
Minified + Gzipped
Latest Version
1.2.12
Package Id
react-native-rate@1.2.12
Unpacked Size
38.12 kB
Size
12.23 kB
File Count
14
NPM Version
9.2.0
Node Version
18.12.0
Published on
Jan 23, 2023
Cumulative downloads
Total Downloads
Last Day
-30.3%
994
Compared to previous day
Last Week
0.7%
42,765
Compared to previous week
Last Month
30.1%
176,485
Compared to previous month
Last Year
-12.6%
2,196,823
Compared to previous year
React Native Rate is a cross platform solution to getting users to easily rate your app.
Apple App Store | Google Play | Amazon | Other Android Markets | All Others |
---|---|---|---|---|
✓ | ✓ | ✓ | ✓ Building your app for a different Android store, you can provide your own URL | ✓ If your platform isn't one of the others, you can input a fallback url to send users to instead |
$ npm i react-native-rate
cd ios && pod install && cd ../
$ react-native link react-native-rate
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-rate
and add RNRate.xcodeproj
libRNRate.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<Add the following to your Podfile
(and run pod install
):
pod 'RNRate', :path => '../node_modules/react-native-rate'
Android, Windows, etc don't use any native code. So don't worry! (There still is linking to Android if you do react-native link. We only left this here so that we can call native code if there is native code to call someday.)
Users using iOS 10.3 (from 2017) and above can now use SKStoreReviewController
to open a Rating Alert right from within their app. There are a few gotchas to using this ReviewController though:
options.preferInApp = true
, the popup will happen on appropriate devices the first time you call it after the app is open. The hack used checks the number of windows the application has. For some reason, when the inapp window is dismissed, it is still on the stack. So if you try it again, the popup will appear (if it is 3 or less times you've done it this year), but after a short delay, the App Store will open too.SKStoreReviewController
, but don't want the App Store App to open after the timeout, you can set openAppStoreIfInAppFails:false
in options. By default, it will open after the timeout.react-native
library since probably 2018, you should be good to use this.preferredAndroidMarket = AndroidMarket.Google
and options.preferInApp = true
, it will open the native UI in the app (see Official docs).1import React from 'react' 2import { View, Button } from 'react-native' 3import Rate, { AndroidMarket } from 'react-native-rate' 4 5export default class ExamplePage extends React.Component { 6 constructor(props) { 7 super(props) 8 this.state = { 9 rated: false 10 } 11 } 12 13 render() { 14 return ( 15 <View> 16 <Button title="Rate App" onPress={()=>{ 17 const options = { 18 AppleAppID:"2193813192", 19 GooglePackageName:"com.mywebsite.myapp", 20 AmazonPackageName:"com.mywebsite.myapp", 21 OtherAndroidURL:"http://www.randomappstore.com/app/47172391", 22 preferredAndroidMarket: AndroidMarket.Google, 23 preferInApp:false, 24 openAppStoreIfInAppFails:true, 25 fallbackPlatformURL:"http://www.mywebsite.com/myapp.html", 26 } 27 Rate.rate(options, (success, errorMessage)=>{ 28 if (success) { 29 // this technically only tells us if the user successfully went to the Review Page. Whether they actually did anything, we do not know. 30 this.setState({rated:true}) 31 } 32 if (errorMessage) { 33 // errorMessage comes from the native code. Useful for debugging, but probably not for users to view 34 console.error(`Example page Rate.rate() error: ${errorMessage}`) 35 } 36 }) 37 }} /> 38 </View> 39 ) 40 } 41}
There are lots of options. You can ignore some of them if you don't plan to have them on that App Store.
Option | Description |
---|---|
AppleAppID | When you create an app in iTunes Connect, you get a number that is around 10 digits long. |
GooglePackageName | Created when you create an app on Google Play Developer Console. |
AmazonPackageName | Create when you create an app on the Amazon Developer Console. |
preferredAndroidMarket | This only matters if you plan to deploy to both Google Play and Amazon or other markets. Since there is no reliable way to check at run time where the app was downloaded from, we suggest creating your own build logic to decipher if the app was built for Google Play or Amazon, or Other markets. Available Options: AndroidMarket.Google, AndroidMarket.Amazon, Other |
preferInApp | If true and user is on iOS, tries to use SKStoreReviewController . If true and user is on Android, it will try to use the native UI. If fails for whatever reason, or user is on another platform, opens the App Store externally. Default false |
fallbackPlatformURL | if ((Platform.OS != 'ios) && (Platform.OS != 'android')) , open this URL. |
inAppDelay | (IOS ONLY) Delay to wait for the InApp review dialog to show (if preferInApp == true). After delay, opens the App Store if the InApp review doesn't show. Default 3.0 |
openAppStoreIfInAppFails | If preferInApp = true but the native iOS and Android UI failed, opens the store externally. Default true |
1// iOS only, not using in-app rating (this is the default) 2const options = { 3 AppleAppID:"2193813192", 4}
1// Android only, able to target both Google Play & Amazon stores. You have to write custom build code to find out if the build was for the Amazon App Store, or Google Play 2import {androidPlatform} from './buildConstants/androidPlatform' // this is a hypothetical constant created at build time 3const options = { 4 GooglePackageName:"com.mywebsite.myapp", 5 AmazonPackageName:"com.mywebsite.myapp", 6 preferredAndroidMarket: androidPlatform == 'google' ? AndroidMarket.Google : AndroidMarket.Amazon 7}
1// targets only iOS app store and Amazon App Store (not google play or anything else). Also, on iOS, tries to open SKStoreReviewController. 2const options = { 3 AppleAppID:"2193813192", 4 AmazonPackageName:"com.mywebsite.myapp", 5 preferredAndroidMarket:AndroidMarket.Amazon, 6 preferInApp:true, 7}
1// targets iOS, Google Play, and Amazon. Also targets Windows, so has a specific URL if Platform isn't ios or android. Like example 2, custom build tools are used to check if built for Google Play or Amazon. Prefers not using InApp rating for iOS. 2import {androidPlatform} from './buildConstants/androidPlatform' // this is a hypothetical constant created at build time 3const options = { 4 AppleAppID:"2193813192", 5 GooglePackageName:"com.mywebsite.myapp", 6 AmazonPackageName:"com.mywebsite.myapp", 7 preferredAndroidMarket: androidPlatform == 'google' ? AndroidMarket.Google : AndroidMarket.Amazon, 8 fallbackPlatformURL:"ms-windows-store:review?PFN:com.mywebsite.myapp", 9}
1// targets 4 different android stores: Google Play, Amazon, and 2 fake hypothetical stores: CoolApps and Andrule 2import {androidPlatform} from './buildConstants/androidPlatform' // this is a hypothetical constant created at build time 3const options = { 4 GooglePackageName:"com.mywebsite.myapp", 5 AmazonPackageName:"com.mywebsite.myapp", 6 preferredAndroidMarket: (androidPlatform == 'google') ? AndroidMarket.Google : (androidPlatform == 'amazon' ? AndroidMarket.Amazon : AndroidMarket.Other), 7 OtherAndroidURL:(androidPlatform == 'CoolApps') ? "http://www.coolapps.net/apps/31242342" : "http://www.andrule.com/apps/dev/21312" 8}
1// Tries to open the SKStoreReviewController in app for iOS only, but if it fails, nothing happens instead of opening the App Store app after 5.0s. Technically, you do not need to add inAppDelay in options below because it has a default value. I am only writing it below to show the difference between openAppStoreIfInAppFails true/false values and what would happen after the inAppDelay. 2const options = { 3 AppleAppID:"2193813192", 4 preferInApp:true, 5 inAppDelay:5.0, 6 openAppStoreIfInAppFails:false, 7}
If you want to keep the same package name and bundle identifier everywhere, we suggest the following:
Though this isn’t specific to this module, some new developers are not quite sure why rating is important.
First off, rating and reviews are technically two different things. Rating being typically a 1-5 star rating, and a review being text that a user writes. Both are important for different reasons.
A higher rating increases your app’s chance of being shown in search results. Some even think that ANY rating will increase your app’s chance, though I don’t know the algorithm. Some users also look at stars and weigh their decision to download or not partially on this metric.
Likewise, reviews give both developers and users good feedback on how the app is doing. Developers can use these reviews as quotes in their app description, and in some stores even reply to reviews (iOS, Google Play, Amazon, and possibly others).
Getting good reviews and good ratings will increase your app’s popularity and downloads. Of course, getting a user to rate your app is mainly about maximizing your probability of success, vs annoying them. There are a lot of articles online on how best to get users to rate your app, but we won’t go into them here.
Your job as the developer, using this module, is to create an experience for the user, and at the right time, ask them to rate. This can be in the form of a pop up, a perpetual button on a settings menu, or after being a level in a game. It’s up to you.
For those that don’t want to read through the code, this module will open a link to the App Store of your choosing based on your options and user’s device. The App Store will be on your app’s page. If possible, it will be on the Ratings/Reviews section.
If possible, the App Store will be opened in the native app for the Store (ie the App Store app). If not possible, it will be opened from the user’s browser.
The only time when the above is not true is for iOS when you setup your options to use the SKStoreReviewController
. In this case, a native UI pop up (created by Apple) is displayed from within you app.
Success in most cases is self explanatory. But for the iOS SKStoreReviewController
case:
--- | success | !success |
---|---|---|
{preferInApp:true} and the SKStoreReviewController successfully opens | ✓ | --- |
{preferInApp:true, openAppStoreIfInAppFails:true} and the SKStoreReviewController fails to open, but opens the App Store App | ✓ | --- |
{preferInApp:true, openAppStoreIfInAppFails:false} and the SKStoreReviewController fails to open, and does not open the App Store App | --- | ✓ |
I moved the podspec file outside of the ios
directory. If you use pods before this version, you may have set paths to ios/RNRate.podspec
. You may need to change that back.
True. According to Apple's documentation, the SKStoreReviewController
should work as expected while in development and production modes, but not one that is distributed via TestFlight.
I plan to add default support for Windows, but haven't personally built any windows app for a few years now. So will do it when it's actually relevant.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
3 existing vulnerabilities detected
Details
Reason
Found 9/16 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-17
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More