Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pankod/react-native-store-rating

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pankod/react-native-store-rating

React Native store rating like Airbnb

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
522
decreased by-10.77%
Maintainers
2
Weekly downloads
 
Created
Source
            

React Native Store Rating

React Native Module to getting users to easily rate your app.

npm version npm downloads per month dependencies Status


Created by Pankod


Ratings and reviews influence how your app ranks in search results, and can affect whether someone downloads your app. Users can rate your app on a scale of desired amount of stars. They can also add a written review for iOS and Android apps.

Stores Supported:

Apple App StoreGoogle Play

Getting started

$ npm install react-native-store-rating --save

or

$ yarn add react-native-store-rating

Usage

Users are presented with a modal allowing them to choose amount of stars which is defined with count props.

The star rate taken from the users is compared to the value defined in "commentOpenRating". If this value is greater than the value of "commentOpenRating", the user is directed to the App store or Google Play Store. If it is equal and smaller, comment popup will be opened and users will be allowed to type comment.

Example: Let's say we defined 3 as a value to commentOpenRating property,

<RateModal
	commentOpenRating={3}
	// ... props
/>

User redirect to App Store or Google Play Store when the given star rate is greater then 3.

Comment modal will be opened if the given star rate equal or less then 3.

Example

import React, { Component } from 'react';
import RateModal from 'react-native-rating-modal';

export default class example extends Component {
    render() {
        return (
            <RateModal
                rateBtnText={'Rate'}
                cancelBtnText={'Cancel'}
                count={5}
                defaultRating={5}
                showRating={true}
                sendBtnText={'Send'}
                placeHolderText={'Placeholder text'}
                nonComment={'Non comment text'}
                androidUrl={'market://details?id=${APP_PACKAGE_NAME}'}
                isModalOpen={true}
                commentOpenRating={3}
                style={{
                    backgroundColor: '#000',
                    paddingHorizontal: 30,
                }}
                ratingOnChange={(e: number) => {
                    console.log('change rating', e);
                }}
                onClosed={() => {
                    console.log('pressed cancel button...')
                }}
                sendContactUsForm={(state: object) => {
                    // state = {
                    // 	isModalOpen: true,
                    // 	rating: 3,
                    // 	review: "Lorem ipsum dolor sit amet...",
                    // 	reviewError:false,
                    // 	showContactForm:true
                    // }
                }}
            />
        )
    }
}


Options


PropertiesTypeDescriptionDefault
sendContactUsForm
*required
FunctionRead component state and function fired when send bottom click{ isModalOpen: true, rating: 3, review: "Lorem ipsum dolor sit amet...", reviewError:false, showContactForm:true }
androidUrl
*required
stringGoogle Play Store App Url
market://details?id=${APP_PACKAGE_NAME}
iosUrl
*required
stringApple ITunes App Url
itms-apps://itunes.apple.com/app/${APP_ID}
rateBtnTextstringThe button text."Rate"
cancelBtnTextstringThe cancel button text."Cancel"
countnumberThe starts count on modal.5
defaulRatingnumberIf no number set, it will determine 3 stars rating.5
showRatingbooleanShows rating on modal. true
sendBtnTextstringThe text of send button."Send"
placeHolderTextstringUser review modal placeholder text."You can write your comments here"
transparentbooleanBackground styletrue
reviewsarrayThe array of rating title.['Terrible', 'Bad', 'Okay', 'Good', 'Great']
nonCommentstringUser review comment box validation text"Please specify your opinion."
isModalOpenbooleanControl if the modal open or not.false
commentOpenRatingnumber?3
styleObjectAn object containing the styles objects to style the modal.example:
{ backgroundColor: #000, paddingHorizontal: 30 }
ratingOnChangeFunctionFunction fired when the rating has changed.return: number
onClosedFunctionFunction fired when the modal has closed.console.warn('pressed cancel button...')


Notes

As of version 1.0.0 this package is compatible with both iOS and Android.

Releases
  • 1.0.0 - Initial release

Keywords

FAQs

Package last updated on 03 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc