MinaSamir11 / react-native-in-app-review

The Google Play In-App Review API, App store rating API lets you prompt users to submit Play Store or App store ratings and reviews without the inconvenience of leaving your app or game.
MIT License
646 stars 56 forks source link

When should I run InAppReview.RequestInAppReview()? #134

Closed bloggerklik closed 9 months ago

bloggerklik commented 1 year ago

Hello, I have a game. If the user has reached level 3, I will ask him to do a review. When should I run InAppReview.RequestInAppReview() in this case?

I want to use Code 1 but I have concerns. It is run every time the user opens the application. There will be constant requests. It will still work when the user clicks later or if the user has already reviewed it. Is there any harm in that?

Code 2 seems to be more secure. However, if the user tapped later and the user leveled up, it will not be displayed later.

Thanks.

Code 1

React.useEffect(() => {
    if(level >= 3){
        InAppReview.RequestInAppReview()
    }
}, []);

Code 2

React.useEffect(() => {
    if(level == 3){
        InAppReview.RequestInAppReview()
    }
}, [level]);
MinaSamir11 commented 1 year ago

Hello,

function lanuchReview(){ const date_lanuched_review = await AsyncStorage.getItem('date_lanuched_review'); if(date_lanuched_review){ const lastDateLaunchedReview = moment(date_lanuched_review).toISOString(); const today = moment(); if (today.diff(lastDateLaunchedReview, 'days') > 8 && level >=3 ) { InAppReview.RequestInAppReview() .then((hasFlowFinishedSuccessfully: boolean) => { if (hasFlowFinishedSuccessfully) { AsyncStorage.setItem("date_lanuched_review", new Date()); } }) .catch((error: any) => { //we continue our app flow. // we have some errors that could happen while launching InAppReview, // Check the table for errors and code numbers that can return in the catch. console.log(error); }); } } else if(level >= 3) { InAppReview.RequestInAppReview() .then((hasFlowFinishedSuccessfully: boolean) => { if (hasFlowFinishedSuccessfully) { AsyncStorage.setItem("date_lanuched_review", new Date()); } }) .catch((error: any) => { //we continue our app flow. // we have some errors that could happen while launching InAppReview, // Check the table for errors and code numbers that can return in the catch. console.log(error); }); } }

bloggerklik commented 1 year ago

@MinaSamir11 Thanks for your answer. The thing I don't understand is this. We do not know whether the user has reviewed before or not. Even if the user reviewed here, InAppReview.RequestInAppReview() is run continuously in the following days. Is this normal? Won't Google and Apple ban my app?

MinaSamir11 commented 9 months ago

Follow this note: https://github.com/MinaSamir11/react-native-in-app-review#quotas