npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-store-review

v0.4.3

Published

Rate on App Store or Google Play directly in your React Native app

Downloads

58,352

Readme

react-native-store-review

This module exposes the native APIs to ask the user to rate the app in the iOS App Store or Google Play store directly from within the app (requires iOS >= 12.4 or Android 5.0 with Google Play store installed).

Installation

# Add dependency
yarn add react-native-store-review
# Link iOS dependency
pod install --project-directory=ios
# Compile project
react-native run-ios # or run-android

Usage

The intention of this API is to ask the user to rate the app as a part of the user journey, typically as the user completes a task. Since it's not possible to know if a dialog will be shown or not you should not call it as a result of tapping a button, but rather as a side effect of an event happening in the app.

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

StoreReview.requestReview();

Button

If you want to show a button or provide a fallback for OS versions not supporting these APIs, you can redirect the user to the respective stores to review the app there instead.

import { Linking, Platform } from 'react-native';

const APP_STORE_LINK = `itms-apps://apps.apple.com/app/id${IOS_APP_ID}?action=write-review`;
const PLAY_STORE_LINK = `market://details?id=${ANDROID_APP_ID}`;

const STORE_LINK = Platform.select({
  ios: APP_STORE_LINK,
  android: PLAY_STORE_LINK,
});

export const openReviewInStore = () => Linking.openURL(STORE_LINK)

References

Troubleshooting

The dialog is not showing in the correct language on iOS

The strings in the dialog comes from the OS, if your translations are purely in JavaScript land you need to add meta data so iOS understand which languages you support, see the official documentation.

The dialog is not showing when I call requestReview()

(1)

For iOS you have to add LSApplicationQueriesSchemes as Array param to Info.plist and add itms-apps as one of params in this array to link appstore.

For example:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>itms-apps</string>
</array>
or (2)

The dialog is not showing while testing with TestFlight but will be working normally once in production (source). Furthermore it will not work for enterprise apps as they are not available on the App Store, and Apple/Google will restrict the amount of times the API can be called to a few times per year in order prevent misuse.