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-rate-app

v1.1.0

Published

React Native module for In App Rating on Android and iOS

Downloads

218

Readme

React Native Rate App

Features

  • 🚀 Easy integration with React Native projects
  • 🔄 Cross-platform support (iOS and Android)
  • 📱 Supports Android 5+ (API level 21+) and iOS 14+
  • 🏗️ Supports the new architecture for React Native
  • 🛒 Supports multiple app stores:
    • Google Play Store
    • Samsung Galaxy Store
    • Huawei AppGallery
    • Apple App Store (iOS)

Installation

yarn add react-native-rate-app

or

npm install react-native-rate-app

iOS Setup

To use the in-app review functionality on iOS, you need to add the StoreKit framework to your project and update your Info.plist file.

Adding the StoreKit Framework

  1. Open your project in Xcode.
  2. Select your project in the Project Navigator.
  3. Select your app target.
  4. Go to the "Build Phases" tab.
  5. Expand the "Link Binary With Libraries" section.
  6. Click the "+" button and add StoreKit.framework.

Updating Info.plist

To allow your app to open the App Store and handle the in-app review functionality, you need to add the LSApplicationQueriesSchemes key to your Info.plist file.

  1. Open your Info.plist file.
  2. Add itms-apps string

Example:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>itms-apps</string>
</array>

API Reference

This library will throw an error if something goes wrong during the execution of its methods. Make sure to handle these errors appropriately in your application.

RateApp.requestReview(options)

Requests a review from the user using the native in-app review dialog.

Parameters

  • options (optional): An object containing the following properties:
    • androidMarket (optional): The market where the app's review request should be directed on Android. Defaults to AndroidMarket.GOOGLE. Supported values are:
      • AndroidMarket.GOOGLE: Google Play Store
      • AndroidMarket.SAMSUNG: Samsung Galaxy Store
      • AndroidMarket.HUAWEI: Huawei AppGallery
    • androidPackageName (optional): The package name of the app to request a review for on Samsung Galaxy Store.

Example

const result = await RateApp.requestReview();
console.log(result); // true if successful, false otherwise

Important Note on Huawei AppGallery and Samsung Galaxy Store In-App Rating

Please note that the in-app rating functionality for Huawei AppGallery and Samsung Galaxy Store has not been thoroughly tested. While the implementation follows the respective guidelines, we recommend conducting your own tests to ensure compatibility and functionality within your application environment.

Huawei AppGallery Requirements

To enable in-app reviews for the Huawei AppGallery, ensure that your app is correctly configured with Huawei Mobile Services (HMS). This functionality leverages Huawei In-App Comments mechanism.

Samsung Galaxy Store Requirements

To enable in-app reviews for the Samsung Galaxy Store, ensure that your app is correctly configured. You must provide the androidPackageName specific to the Samsung Galaxy Store. This functionality leverages the Galaxy Store Broadcast mechanism.

Important Notes

  • Quotas: In-app reviews are subject to rate limits set by the operating system. This means the review dialog might not always appear to the user, depending on how often it has been requested previously. Note that requestReview will return true even if the rate limits have been reached. For more information, please refer to the official documentation from Apple and Google.
  • Development Mode: The in-app review dialog is always displayed in development mode, regardless of rate limits. This is useful for testing purposes.
  • Best Practices: According to operating system guidelines, it is recommended to request a review during a natural flow in your app, rather than from a button. For example, you might request a review after a user has completed a task or achieved a milestone within your app.

Apple Documentation Google Documentation

RateApp.openStoreForReview(options)

Opens the app store page for the app, allowing the user to leave a review.

const result = await RateApp.openStoreForReview({
    iOSAppId: "your-ios-app-id", // Required on iOS, macOS
    androidPackageName: "your.android.package.name", // Required on Android
    androidMarket: AndroidMarket.GOOGLE, // Optional, defaults to GOOGLE
});
console.log(result); // true if successful, false otherwise

Supported Android Markets

The androidMarket option in RateApp.openStoreForReview supports the following markets:

  • AndroidMarket.GOOGLE: Google Play Store
  • AndroidMarket.AMAZON: Amazon Appstore
  • AndroidMarket.SAMSUNG: Samsung Galaxy Store
  • AndroidMarket.HUAWEI: Huawei AppGallery

Updating Info.plist

You need to add the LSApplicationQueriesSchemes key to your Info.plist file to allow your app to open the App Store.

  1. Open your Info.plist file.
  2. Add the following entry:

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you like this project, please consider supporting it by giving it a ⭐️ on GitHub!

Acknowledgements