You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{RatingDialog,RatingDialogOption}from'nativescript-rating-dialog';letratingDialog=newRatingDialog();constoption: RatingDialogOption={title: "Title",icon: "favorite",android: {positiveButtonText: "Send",negativeButtonText: "Cancel",threshold: 3,onThresholdCleared: (dialog,rating,thresholdCleared)=>{},onThresholdFailed: (dialog,rating)=>{},onDialogDismiss: (rating)=>{if(rating<3){console.log(`Negative Rate of ${rating} out of 5`);alert(`Negative Rate of ${rating} out of 5`);}else{alert(`Positive Rate of ${rating} out of 5`);console.log(`Positive Rate of ${rating} out of 5`);}}},ios: {onPositiveButtonText: "Done",onNegativeButtonText: "Send Feedback",onPositiveRate: (rating)=>{console.log('Positive',rating);},onNegativeRate: (rating)=>{console.log('Negative',rating);},onDismiss: ()=>{console.log('Dismiss');}}};ratingDialog.show(option);
API
Rating Dialog Option
Property
Type
Description
icon
string
Set icon (use app icon as default) (optional).
title
string
Set title
textColor
string
Set title text color (optional)
backgroundColor
string
Set background color (optional)
android
AndroidRatingDialogOption
Set android options (optional)
ios
IOSRatingDialogOption
Set iOS options (optional)
Android Rating Dialog Option
Property
Type
Description
threshold
number
Set threshold (number of rating) to trigger the feedback (default is 2)
positiveButtonTextColor
string
Set positive button text color (optional)
negativeButtonTextColor
string
Set negative buttonText color (optional)
positiveButtonText
string
Set positive button text
negativeButtonText
string
Set negative button text (optional)
ratingBarColor
string
Set rating bar color (optional)
ratingBarBackgroundColor
string
Set rating bar background color (optional)
playstoreUrl
string
Set playstore url (to redirect user to the app on app store) (optional)
Set onThresholdCleared callback which fired when your rating score is greater than the threshold. (override the default redirection to Google Play) (optional)
Set onThresholdFailed callback which fired when your rating score is less than the threshold. (use when you want to show your custom feedback form) (optional)