Git Product home page Git Product logo

Comments (8)

rolinger avatar rolinger commented on June 22, 2024 1

@dpa99c - Something def broke. I have two apps. App-1 is still using LaunchReview @3.1.1 and the external App Store window launches just find. In the newer app, App-2, I am using LaunchReview @4.0.0, but it has the same/identical functions as App-1. But on the newer App-2, but its not prompt the dialog box and the external launch is not opening. I am getting same behavior on two different Android devices running, Android 7 and Android 10. I haven't tested on iOS yet.

Specifically, I am seeing:

$scope.rateApp = function() {
   if (LaunchReview.isRatingSupported()) {
      console.log("Supported: true") ;
      $scope.rateAppReview() ;
   } else {
      console.log("Supported: false") ;
      $scope.rateAppLuanch() ;
   }
}

  $scope.rateAppReview = function() {
    var MAX_DIALOG_WAIT_TIME = 5000; //max time to wait for rating dialog to display
    var ratingTimerId;    
    LaunchReview.rating(function(result) {
      console.log("Rating: "+result) ;  // outputs:  "Rating: 0"
      if (result === "requested") {
        ratingTimerId = setTimeout(function() {
          $scope.rateAppStore() ;
        }, MAX_DIALOG_WAIT_TIME);
      } else if (result === "shown") {
        clearTimeout(ratingTimerId);
      } else if(result === "dismissed") {
      }
    },function(err){
        errMgmt("menu/rateApp",2600.1,"Error opening rating dialog: " + err) ;        
        $scope.rateAppStore() ;
    });
  }

Console is outputting:

Supported: true
Rating: 0

Its not opening the dialog box...and with a rating result == 0, its never making into any of the rating result conditions (ie: requested, shown, dismissed). So, the question is, why would isRatingSupported() return true, but then in rating() itself the result is returning displaying 0 (which I interpret as 'false')?

As a temp work around on App-2, I had to add a result condition to pop the App Store review screens:

    LaunchReview.rating(function(result) {
      console.log("Rating: "+result) ;  // outputs:  "Rating: 0"
      if (result === "requested") {
        ratingTimerId = setTimeout(function() {
          $scope.rateAppStore() ;
        }, MAX_DIALOG_WAIT_TIME);
      } else if (result === "shown") {
        clearTimeout(ratingTimerId);
      } else if(result === "dismissed") {
      } else if (result === 0) {
         $scope.rateAppStore() ;
      }
   }) ;

from cordova-launch-review.

dpa99c avatar dpa99c commented on June 22, 2024

Please try building and running the example project app which is a known working codebase for reference.

from cordova-launch-review.

julianlecalvez avatar julianlecalvez commented on June 22, 2024

Hi, thank for this answer.
I installed it, I put the id for my existing app on the play store, and I got the same result : the LaunchReview works work but for the Inapp rating, i only get the success alert on both my android devices.

cordova-launch-review-in-app-rating

cordova-launch-review-is-supported-rating

from cordova-launch-review.

dpa99c avatar dpa99c commented on June 22, 2024

If I run the latest version of the plugin in the example project with the package ID of one of my own apps, it works fine:

So if you're sure the app package ID is valid/exists in the Play Store, then the problem must be in your development environment.
I suggest debugging in Android Studio and looking at the logcat output for errors.

However I'm closing this as I'm satisfied from testing that this plugin functionality is working correctly - I also have it deployed in live apps and see it being used by real Android users.

from cordova-launch-review.

julianlecalvez avatar julianlecalvez commented on June 22, 2024

Even if it's an environment issue (which is a guess), it would be better to let it open in case another developer have the same problem and can help, don't you think ?

from cordova-launch-review.

julianlecalvez avatar julianlecalvez commented on June 22, 2024

Ok, i tried with a fresh installation of cordova (10.0.0), and android studio on another computer, and the example still doesn't work on android.

from cordova-launch-review.

rolinger avatar rolinger commented on June 22, 2024

@dpa99c - is 4.0.0 specifically for Android 11 thus the updated .rating() returning a result==0 response that means something to Android 11 and has no relevance to Android 7 - 10 ? Just a thought.

from cordova-launch-review.

rolinger avatar rolinger commented on June 22, 2024

@dpa99c - just took a look at the code again. I see the Advanced .rating() has changed from previous version. I updated my code but the problem is still happening because result==0 and regardless of platform === "android" the dialog box is not prompting and there is no condition to use the external app rating window.

To get it to work, still had to modify with the following - but this works on Android 7 - 10, I have not been able to test it on Android 11 and am thinking my code workaround would cause the in-app dialog launch AND the external app store rating to launch.

var MAX_DIALOG_WAIT_TIME = 5000; //max time to wait for rating dialog to display
var ratingTimerId;

LaunchReview.rating(function(result){
     if(cordova.platformId === "ios" || result === 0){
        if(result === "requested"){
            console.log("Requested display of rating dialog");
            
            ratingTimerId = setTimeout(function(){
                console.warn("Rating dialog was not shown (after " + MAX_DIALOG_WAIT_TIME + "ms)");
            }, MAX_DIALOG_WAIT_TIME);
        }else if(result === "shown"){
            console.log("Rating dialog displayed");
            
            clearTimeout(ratingTimerId);
        }else if(result === "dismissed"){
            console.log("Rating dialog dismissed");
        }
    } else if(cordova.platformId === "android"){
        console.log("Rating dialog displayed");
    }
    
},function(err){
    console.log("Error opening rating dialog: " + err);
});

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.