Comments (5)
For android, here is my fix:
LaunchReview.rating(function(result){
if (cordova.platformId === "android"){
if (result === 0) {
errMgmt("menu/rateApp",2601.3,"Android: In-App Review failed, opening store review.") ;
$scope.rateAppStore() ;
} else {
errMgmt("menu/rateApp",2601.4,"Android: In-App Review opened.") ;
}
} else if(cordova.platformId === "ios"){
if (result === "requested"){
ratingTimerId = setTimeout(function(){
$scope.rateAppStore() ;
}, MAX_DIALOG_WAIT_TIME);
} else if (result === "shown"){
errMgmt("menu/rateApp",2601.5,"iOS: In-App Review opened.") ;
clearTimeout(ratingTimerId);
} else if (result === "dismissed"){
} else {
// default open app store review
errMgmt("menu/rateApp",2601.6,"iOS: In-App Review failed, opening store review.") ;
}
}
},function(err){
errMgmt("menu/rateApp",2601.7,"In-App Review function failed, opening store review.") ;
$scope.rateAppStore() ;
});
}
from cordova-launch-review.
The same thing happened to me on Android. I'm receiving status == 0
and dialog is not opening. I tested on Galaxy Note 10, Android 10.
Packages version:
cordova: 8.1.2,
cordova-android: 7.1.2,
cordova-ios: 5.1.1,
cordova-launch-review: 4.0.0
Code usage:
const LaunchReview: LaunchReviewPlugin = window.LaunchReview;
const platformId = window.cordova && window.cordova.platformId;
const IOS: string = 'ios';
const ANDROID: string = 'android';
const MAX_DIALOG_WAIT_TIME: number = 5000;
let ratingTimerId: NodeJS.Timeout;
export const cordovaDriver = {
rating: () => new Promise((resolve, reject) => {
LaunchReview.rating((status => {
if (platformId === ANDROID) {
const message = 'Rating dialog displayed';
resolve({status: PROMPT_DISPLAY_STATUS.SHOWN, message})
}else if (platformId === IOS) {
if (status === PROMPT_DISPLAY_STATUS.REQUESTED) {
ratingTimerId = setTimeout(() => {
const message = `Rating prompt was not shown after ${MAX_DIALOG_WAIT_TIME}ms`;
reject( message);
}, MAX_DIALOG_WAIT_TIME);
} else if (status === PROMPT_DISPLAY_STATUS.SHOWN) {
clearTimeout(ratingTimerId);
const message = 'Rating prompt was shown';
resolve({status: PROMPT_DISPLAY_STATUS.SHOWN, message})
}
}
}), (err) => {
const errMessage = `Error opening rating prompt: ${err}`;
reject(errMessage);
});
}),
}
Calling this method by:
export async function showAppRatingPrompt () {
// Service-level method
try {
return await cordovaDriver.rating()
}catch (err) {
console.error(`[ LAUNCH REVIEW SERVICE ] ${err}`)
}
}
from cordova-launch-review.
Will take a look into this when I get a moment
from cordova-launch-review.
I'm integrating this module and I'm also seeing the same 0 result for android, as described above in the first example, with the same code.
from cordova-launch-review.
Just published a fix for this issue in v4.0.1
See updated documentation and example project for reference.
from cordova-launch-review.
Related Issues (20)
- Why "Submit" button is disabled? HOT 4
- App rating dialog takes a bit of time to appear HOT 1
- The donate button in the github readme is broken. HOT 3
- rating() function returns no other results than "requested" HOT 2
- Multi-language supported ? HOT 1
- display a review dialog after x time of use / lunch - Android - HOT 1
- how can i call the review after x lunchs HOT 1
- Add support for in-app reviews on Android HOT 4
- Android inapp review - optional comment HOT 1
- If the rating dialog is displayed successfully on iOS, the result will not be returned. HOT 3
- Unable to have the rating() function working for android HOT 8
- Ionic 5 using native api capacitor HOT 1
- how to open the "write review"tab on iOS ? HOT 1
- ERROR NullInjectorError: R3InjectorError(Or)[t -> t -> t]: NullInjectorError: No provider for t! HOT 1
- Android doesn't open the Google Play In-App Reviews APIs of the app. HOT 1
- Error after posting review (android)
- iOS `requestReview` API was deprecated. HOT 3
- package.json missing dependency HOT 1
- com.google.android.play:core 1.8.0 deprecation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-launch-review.