Git Product home page Git Product logo

Comments (5)

rolinger avatar rolinger commented on June 22, 2024

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.

panderium-art avatar panderium-art commented on June 22, 2024

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.

dpa99c avatar dpa99c commented on June 22, 2024

Will take a look into this when I get a moment

from cordova-launch-review.

Wunderkemmer avatar Wunderkemmer commented on June 22, 2024

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.

dpa99c avatar dpa99c commented on June 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.