Closed AlenToma closed 1 year ago
@AlenToma you should probably do that on the react-native side, with a simple value such as:
AsyncStorage.setItem(REVIEW_DONE_KEY, 'true');
And then check it later:
const reviewDone = await AsyncStorage.getItem(REVIEW_DONE_KEY);
if (reviewDone) {
return;
}
Hello @AlenToma
sorry for the late,
please let me know if this code couldn't help you to answer your question:
useEffect(()=>{
lanuchReview()
});
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);
});
}
}
Hi, thx for the library, it's really great.
I was wondering is it possible to implement if the user has a review already for the app.
This is imported becouse when doing request the app goes in the background for a moment even though the dialog dose not necceray show upp.
It will be great if there is a method that says hasAction or something like that.
Would also be happy to help if you could point me to a right direction. I could do it my self and post it here.
Becouse as I checked there no such a method in
com.google.android.play.core.review.ReviewManager
I may be wrong though as I am not an expert in java.