Giter Site home page Giter Site logo

ezebecke / react-native-store-review Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oblador/react-native-store-review

0.0 0.0 0.0 703 KB

Rate on App/Play Store directly in your React Native app

License: MIT License

Shell 1.17% JavaScript 3.64% Ruby 7.38% C++ 17.74% Objective-C 6.12% Java 47.91% TypeScript 1.60% Objective-C++ 12.31% CMake 0.66% Starlark 1.47%

react-native-store-review's Introduction

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 >= 10.3 or Android 5.0 with Google Play store installed).

Rating Dialog

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.

react-native-store-review's People

Contributors

anback avatar frenberg avatar iroachie avatar jorisw avatar koenpunt avatar lolobosse avatar mainak-shil avatar makenova avatar nsundberg avatar oblador avatar radko93 avatar simonemarinelli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.