Git Product home page Git Product logo

cordova-launch-review's Introduction

Cordova Launch Review plugin Latest Stable Version Total Downloads

Table of Contents

Overview

Cordova/Phonegap plugin for iOS and Android to assist in leaving user reviews/ratings in the App Stores.

  • Launches the platform's App Store page for the current app in order for the user to leave a review.
  • On iOS 10.3 and above, invokes the native in-app rating dialog which allows a user to rate your app without needing to open the App Store.
  • On Android, invokes the native in-app review dialog

The plugin published to npm as cordova-launch-review

donate

I dedicate a considerable amount of my free time to developing and maintaining this Cordova plugin, along with my other Open Source software. To help ensure this plugin is kept updated, new features are added and bugfixes are implemented quickly, please donate a couple of dollars (or a little more if you can stretch) as this will help me to afford to dedicate time to its maintenance. Please consider donating if you're using this plugin in an app that makes you money, if you're being paid to make the app, if you're asking for new features or priority bug fixes.

Installation

Using the Cordova/Phonegap CLI

$ cordova plugin add cordova-launch-review

Usage

The plugin is exposed via the LaunchReview global namespace.

launch()

Platforms: Android and iOS

Launches the App Store page for the current app in order for the user to leave a review.

  • On Android, opens the app's in the Play Store where the user can leave a review by pressing the stars to give a rating.

  • On iOS, opens the app's page in the App Store and automatically opens the dialog for the user to leave a rating or review.

    LaunchReview.launch(success, error, appId);

Parameters

  • {function} success - (optional) function to execute on successfully launching store app.
  • {function} error - (optional) function to execute on failure to launch store app. Will be passed a single argument which is the error message string.
  • {string} appID - (optional) the platform-specific app ID to use to open the page in the store app
    • If not specified, the plugin will use the app ID for the app in which the plugin is contained.
    • On Android this is the full package name of the app. For example, for Google Maps: com.google.android.apps.maps
    • On iOS this is the Apple ID of the app. For example, for Google Maps: 585027354

Simple usage

LaunchReview.launch();

Advanced usage

var appId, platform = device.platform.toLowerCase();

switch(platform){
    case "ios":
        appId = "585027354";
        break;
    case "android":
        appId = "com.google.android.apps.maps";
        break;
}

LaunchReview.launch(function(){
    console.log("Successfully launched store app");
},function(err){
    console.log("Error launching store app: " + err);
}, appId);

rating()

Platforms: Android and iOS

  • On iOS 10.3 and above, invokes the native in-app rating dialog which allows a user to rate your app without needing to open the App Store.

  • On Android, invokes the native in-app review dialog which allows a user to rate/review your app without needing to open the Play Store.

    LaunchReview.rating(success, error);

iOS notes

  • The Rating dialog will not be displayed every time LaunchReview.rating() is called - iOS limits the frequency with which it can be called (see here).
  • The Rating dialog may take several seconds to appear while iOS queries the Apple servers before displaying the dialog.
  • The success function will be called up to 3 times:
    • First: after LaunchReview.rating() is called and the request to show the dialog is successful. Will be passed the value requested.
    • Second: if and when the Rating dialog is actually displayed. Will be passed the value shown.
    • Third: if and when the Rating dialog is dismissed. Will be passed the value dismissed.
  • Detection of the display of the Rating dialog is done using inspection of the private class name.
    • This is not officially sanctioned by Apple, so while it should pass App Store review, it may break if the class name is changed in a future iOS version.
  • Since there's no guarantee the dialog will be displayed, and even then it may take several seconds before it displays, the only way to determine if it has not be shown is to set a timeout after successful requesting of the dialog which is cleared upon successful display of the dialog, or otherwise expires after a pre-determined period (i.e. a few seconds).

Android notes

  • Be sure to follow the Android guidelines on when to request an in-app review
  • Google Play enforces a quota on how often a user can be shown the review dialog which means the dialog might not display after you call this method.
  • The user must first rate your app in the native dialog before being shown the review textarea input.
  • Neither success or error will not be called if dialog was not shown due to rate limiting, etc.
    • If you need to know the outcome it's therefore best to set timeout after which you assume the dialog has failed to show - see the example project for an example of this.
  • If you're having problems with getting the native rating dialog to appear, make sure you've followed all the steps in the Android guidelines on testing in-app reviews.

Parameters

  • {function} success - (optional) function to execute on successfully requesting (note: this does not guarantee it will be displayed) the launch rating dialog
    • iOS
      • Will be passed a single string argument which indicates the result: requested, shown or dismissed.
      • Will be called the first time after LaunchReview.rating() is called and the request to show the dialog is successful with value requested.
      • May be called a second time if/when the rating dialog is successfully displayed with value shown.
      • May be called a third time if/when the rating dialog is dismissed with value dismissed.
    • Android
      • Will be passed a single string argument which indicates the result: requested
      • May be called once after the dialog was successfully displayed and the user dismisses the dialog.
  • {function} error - (optional) function to execute on failure to launch rating dialog.
    • Will be passed a single argument which is the error message string.

Simple usage

LaunchReview.rating();

Advanced usage

//max time to wait for rating dialog to display on iOS
var MAX_DIALOG_WAIT_TIME_IOS = 5*1000; 

//max time to wait for rating dialog to display on Android and be submitted by user
var MAX_DIALOG_WAIT_TIME_ANDROID = 60*1000; 

var ratingTimerId;

function ratingDialogNotShown(){
    var msg;
    if(cordova.platformId === "android"){
        msg = "Rating dialog outcome not received (after " + MAX_DIALOG_WAIT_TIME_ANDROID + "ms)";
    }else if(cordova.platformId === "ios"){
        msg = "Rating dialog was not shown (after " + MAX_DIALOG_WAIT_TIME_IOS + "ms)";
    }
    console.warn(msg);
}

function rating(){
    if(cordova.platformId === "android"){
        ratingTimerId = setTimeout(ratingDialogNotShown, MAX_DIALOG_WAIT_TIME_ANDROID);
    }

    LaunchReview.rating(function(status){
        if(status === "requested"){
            if(cordova.platformId === "android"){
                console.log("Displayed rating dialog");
                clearTimeout(ratingTimerId);
            }else if(cordova.platformId === "ios"){
                console.log("Requested rating dialog");
                ratingTimerId = setTimeout(ratingDialogNotShown, MAX_DIALOG_WAIT_TIME_IOS);
            }
        }else if(status === "shown"){
            console.log("Rating dialog displayed");
            clearTimeout(ratingTimerId);
        }else if(status === "dismissed"){
            console.log("Rating dialog dismissed");
            clearTimeout(ratingTimerId);
        }
    }, function (err){
        console.error("Error launching rating dialog: " + err);
        clearTimeout(ratingTimerId);
    });
}

rating(); // app invokes eg. via UI action

isRatingSupported()

Platforms: Android and iOS

Indicates if the current platform/version supports in-app ratings dialog, i.e. calling LaunchReview.rating(). Will return true if current platform is Android or iOS 10.3+.

var isSupported = LaunchReview.isRatingSupported();

Example usage

if(LaunchReview.isRatingSupported()){
    LaunchReview.rating();
}else{
    LaunchReview.launch();
}

Example project

An example project illustrating use of this plugin can be found here: https://github.com/dpa99c/cordova-launch-review-example

License

================

The MIT License

Copyright (c) 2015-2020 Working Edge Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cordova-launch-review's People

Contributors

dpa99c avatar ecofriendlyapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-launch-review's Issues

rating() function returns no other results than "requested"

I'm submitting a ... (check one with "x"):

  • bug report
  • feature request
  • documentation issue

Bug report

Current behavior:

The LaunchReview.rating() never returns other results than the requested result. No shown or dismissed is ever called.

Expected behavior:

The LaunchReview.rating() should work as described in the readme and returns different results for different scenarios.

Steps to reproduce:

Call the following code and observe console for the result returned when dealing with the rating window:

LaunchReview.rating( function(result) {
  console.log('result:', result);
}, function(err){
 console.log('error:', err);
})

Environment information

  • Cordova CLI version
    8.1.2
  • Cordova platform version
    4.5.5
  • Plugins & versions installed in project (including this plugin)

cordova-launch-review 3.1.1

  • Dev machine OS and version, e.g.
    • OSX Mojave 10.14.6

XCode 11.3

Runtime issue

  • Device details
    iPhone 8 Simulator

  • OS details
    iOS 13.3

  • XCode version

XCode 11.3

Android doesn't open the Google Play In-App Reviews APIs of the app.

Bug report

CHECKLIST

  • I have reproduced the issue using the example projector provided the necessary information to reproduce the issue.
  • I have read the documentation thoroughly and it does not help solve my issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

When the modal prompt is shown there is nothing to review, this plugin only redirects to the apps's main page app store.

Expected behavior:

We should review the app as described in the google play in-app API.

Steps to reproduce:

  1. npm install @awesome-cordova-plugins/launch-review
  2. npm install cordova-launch-review
  3. cordova plugin add cordova-launch-review
  4. add LaunchReview to the app Module.
  5. Launch the plugin.

or use the example provided by modifying the Id on the launch function like the following:

function launchreview(){
LaunchReview.launch(function (){
showAlert("Successfully launched review app");
}, function (err){
showAlert("Error launching review app: " + err);
}, 'com.cbord.get');
}

Screenshots

Environment information

  • Cordova CLI version
    • 11.0.0
  • Cordova platform version
    • cordova platform ls
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
  • Dev machine OS and version, e.g.
    • OSX

Runtime issue

  • Device details
    • e.g. iPhone X, Samsung Galaxy S8, iPhone X Simulator, Pixel XL Emulator
  • OS details
    • e.g. iOS 12.2, Android 9.0

Android build issue:

  • Node JS version
    • v14.18.1
  • Gradle version
    • gradle-7.2
  • Target Android SDK version
    • android:targetSdkVersion in AndroidManifest.xml
  • Android SDK details
    • sdkmanager --list | sed -e '/Available Packages/q'

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

/Users/x/Library/Android/sdk ➜ cordova-launch-review-example git:(master) cordova run android --stacktrace Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=/Users/x/Library/Android/sdk (recommended setting) ANDROID_HOME=/Users/x/Library/Android/sdk (DEPRECATED) Using Android SDK: /Users/x/Library/Android/sdk Subproject Path: CordovaLib Subproject Path: app Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 > Task :CordovaLib:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.

Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
19 actionable tasks: 3 executed, 16 up-to-date
Command failed with exit code 1: /Users/x/Projects/company/POCS/cordova-launch-review-example/platforms/android/gradlew cdvBuildDebug -b /Users/x/Projects/company/POCS/cordova-launch-review-example/platforms/android/build.gradle


// Paste any relevant JS/native console output here

function launchreview(){
    LaunchReview.launch(function (){
        showAlert("Successfully launched review app");
    }, function (err){
        showAlert("Error launching review app: " + err);
    }, 'com.cbord.get');
}



Other information:

Please update graddle version if possible.

iOS `requestReview` API was deprecated.

Bug report

CHECKLIST

  • I have reproduced the issue using the example projector provided the necessary information to reproduce the issue.
  • I have read the documentation thoroughly and it does not help solve my issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

requestReview API is deprecated

https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview?language=objc

Expected behavior:

Should use requestReviewInScene API

Launch not working on iOS 11

LaunchReview.launch(storeId) is not working anymore on iOS11.
It launches App Store App but then a message "Cannot Connect to App Store" is displayed.

isRatingSupported() returns true on iPad version 9.3.5

Hello,

Great plugin, thanks for all the hard work.

It appears that isRatingSupported() only works correctly on the iPhone, not on the iPad Mini. It returns true in all circumstances on the iPad.

My limited knowledge in this area would suggest this is probably down to the use of the constant: __IPHONE_10_3 AND __IPHONE_OS_VERSION_MAX_ALLOWED in LaunchReview.m.

Error after posting review (android)

Bug report

  • I have read the issue reporting guidelines

  • I confirm this is a suspected bug or issue that will affect other users

  • I have reproduced the issue using the example projector provided the necessary information to reproduce the issue - Cannot be reproduced with the example since it is not starting a real review window.

  • I have read the documentation thoroughly and it does not help solve my issue.

  • I have checked that no similar issues (open or closed) already exist.

Current behavior:
After submitting the review an error is shown. In logcat I could only find:
Finsky : [2] riw.b(2): Error posting review: network time: 0, HTTP status code: 400, exception com.google.android.finsky.networkrequests.NetworkRequestException: Error retrieving information from server. DF-DFERH-01 and the review doesn't get submitted to Google Play Store. I tried this on two different devices and with different google play accounts but it is always the same. The app is already in Google Play available, but I still did test it with the internal test track. Not sure if this is even supposed to work in the internal test track?

Expected behavior:
There should be no error once the review is submitted and the review should be available in Google Play Store.

Steps to reproduce:

  • Rating window is shown
  • Once pressed on the stars the review textfield gets shown
  • When the review text is entered and submitted the native popup comes up that the review was submitted but once that disappears the error will be shown.

Environment information

  • Cordova CLI version
    11.0.0
  • Cordova platform version
    Installed platforms:
    android 10.1.2
    ios 6.2.0
  • Dev machine OS and version, e.g.
    • OSX
      ProductName: macOS
      ProductVersion: 12.4
      BuildVersion: 21F79

Runtime issue

  • Device details
    Samsung Galaxy S9+, OnePlus A6003
  • OS details
    • Android 10, Android 8.1.0

Multi-language supported ?

Is there any way to change the language of the Rating Modal windows? I am developing a multi-language app and I'd love to open the Modal Window in the selected language in the app by the user. Is this possible?

Thank you,
Ernesto

Predefined rating value

Need some config parameter to pass in launch function as first argument:

var config = {
    rating: 3
};

LaunchReview.launch(config, successCallback, errorCallback);

And this will open App Store or Google Play with 3-stars rating.

Any thoughts?

Android inapp review - optional comment

Hello, first thank you for this great plugin.
On android, we tested internally the new feature (native in app review). It ask for a mandatory comment after giving a rating, but in the documentation screenshots show leaving a comment is optional ?
How to set this plugin to optional ?

Thanks

MIT License?

Is this an open source project? MIT license?

Thank you.

Windows Phone support

Would you be open to supporting Windows Phone in the launch() method, which would redirect to the appropriate store URL (e.g. 'ms-windows-store://pdp/?ProductId=<the apps Store ID>')?

Happy to submit a PR!

`Apple ID`or `Bundle ID` for use in appID parameter

I'm submitting a ... (check one with "x"):

  • bug report
  • feature request
  • documentation issue

Documentation issue

In Documentation you wrote:

{string} appID [...] If not specified, the plugin will use the app ID for the app in which the plugin is contained

But for iOS is not clear if this is a Apple IDor Bundle ID.

I assume that it is Bundle ID cause this is only one that we can set in Xcode on General > Bundle Identifier

In the same time as parameter in launch() Advanced usage is used Apple ID - when I try to use Bundle Id I get an error appears: App not found.

Can you clarify this issue in Documentation: which one (Apple IDor Bundle ID) should be used?

BTW Is ratingmrthod also use Bundle ID as default?

App rating dialog takes a bit of time to appear

I'm submitting a ... (check one with "x"):

  • bug report
  • feature request
  • documentation issue

Bug report

Current behavior:

When I'm using the plugin feature of showing the app rating dialog, the first time it takes a few seconds to appear. And the following attempts are almost instantaneous.

Expected behavior:

Being almost instantaneous from the first attempt.

Note: I'm connected to Wifi so the problem should not be something about downloading remote information.

Steps to reproduce:

Environment information

I'm using an iPhone 6 with iOS 12.2

Thank you @dpa99c , you've done a great job :)

Error cases for LaunchReview.rating()

I was reading through some of the obscure details around iOS in-app review (http://daringfireball.net/2017/01/new_app_store_review_features), and I came across two worrisome points.

If a customer has rated the app, they will not be prompted again. If a customer has dismissed the review prompt three times, they will not be asked to review the app for another year.

Do you happen to know whether the error handler will be called in each of those cases? For us, we ask the user directly if they're interested in reviewing the app before calling LaunchReview.rating(), so we want to make sure we know whether the dialog popped up.

package.json missing dependency

Bug report

CHECKLIST

  • [x ] I have reproduced the issue using the example projector provided the necessary information to reproduce the issue.
  • [x ] I have read the documentation thoroughly and it does not help solve my issue.
  • [ x] I have checked that no similar issues (open or closed) already exist.

Current behavior:

I do an npm i @awesome-cordova-plugins/launch-review
I do a build and get a missing dependency error:

⠏ update ios [warn] Plugins are missing dependencies.
Cordova plugin dependencies must be installed in your project (e.g. w/ npm install).

   cordova-launch-review is missing dependencies:
   - cordova-plugin-device (^2.0.3)

Your package.json dependencies are empty

Expected behavior:

Steps to reproduce:

I do an npm i @awesome-cordova-plugins/launch-review
I do a build and get a missing dependency error:

⠏ update ios [warn] Plugins are missing dependencies.
Cordova plugin dependencies must be installed in your project (e.g. w/ npm install).

   cordova-launch-review is missing dependencies:
   - cordova-plugin-device (^2.0.3)

Your package.json dependencies are empty

Screenshots

Environment information

  • Cordova CLI version
    • cordova -v
  • Cordova platform version
    • cordova platform ls
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
  • Dev machine OS and version, e.g.
    • OSX
      • sw_vers
    • Windows 10
      • winver

Runtime issue

  • Device details
    • e.g. iPhone X, Samsung Galaxy S8, iPhone X Simulator, Pixel XL Emulator
  • OS details
    • e.g. iOS 12.2, Android 9.0

Android build issue:

  • Node JS version
    • node -v
  • Gradle version
    • ls platforms/android/.gradle
  • Target Android SDK version
    • android:targetSdkVersion in AndroidManifest.xml
  • Android SDK details
    • sdkmanager --list | sed -e '/Available Packages/q'

iOS build issue:

  • Node JS version
    • node -v
  • XCode version

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

console output

// Paste any relevant JS/native console output here



Other information:

If the rating dialog is displayed successfully on iOS, the result will not be returned.

Bug report

CHECKLIST

  • I have reproduced the issue using the example projector provided the necessary information to reproduce the issue.
  • I have read the documentation thoroughly and it does not help solve my issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

If the rating dialog is displayed successfully on iOS, the result will not be returned.

Expected behavior:

result returns show if rating dialog is displayed successfully on iOS

Steps to reproduce:

I haven't written any special code

Screenshots

image0 2
unnamed 1

Environment information

  • Cordova CLI version
    • 10.0.0
  • Cordova platform version
  • Plugins & versions installed in project (including this plugin)
    cordova-launch-review 4.0.0 "Launch Review"
    cordova-plugin-device 2.0.3 "Device"
    cordova-plugin-whitelist 1.3.4 "Whitelist"

Runtime issue

  • Device details
    • iPhone X
  • OS details
    • iOS 13.3.1

iOS build issue:

  • Node JS version
    • 10.16.0
  • XCode version
    • 12

Related code:

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

Console output

console output
[Log] Running [email protected] (cordova.js, line 1413)
[Log] result: requested (cordova.js, line 1413)
[Log] Requested display of rating dialog (cordova.js, line 1413)
[Warning] Rating dialog was not shown (after 5000ms) (cordova.js, line 1413)


Other information:

When the rating dialog is displayed
It has been confirmed that the windowDidBecomeVisibleNotification of LaunchReview.m is called.
At this time, notification.object was not MonitorObject but SKStoreReviewPresentationWindow was returned.

It seems to be related to the issue below
#18

Simplify the API: detect appId automatically

I think at least in Android it would be possible to detect the bundle ID automatically. It is equal to the config.xml value. For iOS apps its a little bit more difficult, as we only have the [NSBundle mainBundle].bundleIdentifier.

Also couldn't we get rid of the separate inAppRating functions for iOS and instead use a unified rate function that:

  1. Detects the running appId automatically
  2. Opens the app store to rate the app or displays the inApp review if possible and specified as an option inApp: true.

Then there is no boilerplate code needed in the app.
We would have to decide on the default value of inApp option. I think it should be true so that newer iOS versions always show the inApp rating. In case the developer always wants the user to go to the store to rate she would have to set it to false.

What do you think?

What for the native code?

I wonder why you decided to implement the store calls in native code?
Wouldn't document.location.href="market://details?id=appId do the same? Similar for iOS.
The only native function would be the new in-app review.

I try to understand the historical reason. Maybe this was not possible 2 years ago to just launch the store URLs from script?

Unable to have the rating() function working for android

Bug report

CHECKLIST

  • I have reproduced the issue using the example projector provided the necessary information to reproduce the issue.
  • I have read the documentation thoroughly and it does not help solve my issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

I try to integrate the plugin in my ionic / cordova application.
I don't have any problem with iOS, I get the popup with the app icon and the 5 stars to fill. However, i can't get it with 2 android devices. The isSupportedRating() returns true, but when i run this code (the same that is working for iOS), nothing happens, but i get the success log in the console (with the param variable 0). I put the code below.

It seems it's a configuration issue, or an ionic incompatibility, because there's no other bugs reported about that, and there's no reason it doesn't work. The launchReview function works perfectly, this is why I don't think it's a
I tried to look at the Android in-app review documentation, and I checked the requirements :

  • I use at least the Android 5.0 sdk (API 21) because I use the API 28.
  • I have the google play store installed on my device (the launchReview works and take me to my app)
  • I updated the Play Core library to 1.8.2 in my gradle config, but i already was using the 1.8.0 which matches the requirements.

Expected behavior:
Showing the android review popup in the app.

Environment information

  • Cordova CLI version
  • Cordova platform version
    • android 8.1.0
  • Plugins & versions installed in project (including this plugin)
cordova-launch-review 4.0.0 "Launch Review"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-firebase-analytics 4.3.0 "FirebaseAnalyticsPlugin"
cordova-plugin-local-notification 0.9.0-beta.3 "LocalNotification"
cordova-plugin-market 1.2.0 "Market"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.3.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova-support-android-plugin 1.0.1 "cordova-support-android-plugin"
cordova-support-google-services 1.4.0 "cordova-support-google-services"
ionic-plugin-keyboard 2.2.1 "Keyboard"
  • Dev machine OS and version, e.g.
    • OSX
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G11023

Runtime issue

  • Device and OS details
    • Samsung Galaxy S7 Edge - Android 8.0.0
    • Huawei P30 Pro - Android 10

Android build issue:

  • Node JS version
    • v10.16.0
  • Gradle version
    • 4.10.3 buildOutputCleanup vcs-1
  • Target Android SDK version
    • 28
  • Android SDK details
Installed packages:=====================] 100% Computing updates...
  Path                               | Version | Description                    | Location
  -------                            | ------- | -------                        | -------
  build-tools;26.0.2                 | 26.0.2  | Android SDK Build-Tools 26.0.2 | build-tools/26.0.2/
  build-tools;28.0.3                 | 28.0.3  | Android SDK Build-Tools 28.0.3 | build-tools/28.0.3/
  build-tools;29.0.2                 | 29.0.2  | Android SDK Build-Tools 29.0.2 | build-tools/29.0.2/
  emulator                           | 29.0.11 | Android Emulator               | emulator/
  extras;android;m2repository        | 30.0.0  | Android Support Repository     | extras/android/m2repository/
  extras;google;google_play_services | 49      | Google Play services           | extras/google/google_play_services/
  extras;google;m2repository         | 25      | Google Repository              | extras/google/m2repository/
  patcher;v4                         | 1       | SDK Patch Applier v4           | patcher/v4/
  platform-tools                     | 29.0.2  | Android SDK Platform-Tools     | platform-tools/
  platforms;android-25               | 3       | Android SDK Platform 25, rev 3 | platforms/android-25/
  platforms;android-26               | 2       | Android SDK Platform 26        | platforms/android-26/
  platforms;android-27               | 3       | Android SDK Platform 27        | platforms/android-27/
  platforms;android-28               | 6       | Android SDK Platform 28        | platforms/android-28/
  sources;android-25                 | 1       | Sources for Android 25         | sources/android-25/
  sources;android-28                 | 1       | Sources for Android 28         | sources/android-28/
  tools                              | 26.1.1  | Android SDK Tools              | tools/

Available Packages:

Related code:

	console.log('isRatingSupported ?', this.launchReview.isRatingSupported());

	this.launchReview.rating().then((param) => {
		console.log('Successfully launched rating ', param);
	}, (err) => {
		console.log("Error launching rating: ", err);
	});

Console output:

16:32:43.790 isRatingSupported ? true
16:32:43.815 Successfully launched rating  0

Great job for the lib, and I hope anyone will be able to help me :)

Why "Submit" button is disabled?

img_0294


I'm submitting a ... (check one with "x"):

  • bug report
  • feature request
  • documentation issue

Bug report

The "Submit" button is disabled. Why?

Expected behavior:

The "Submit" button is enabled

Steps to reproduce:

Call this.launchReview.rating()

Environment information

  • Cordova CLI version
  • Cordova platform version
    • ios 4.5.5
  • Plugins & versions installed in project (including this plugin)
com.omarben.inappreview 0.0.5 "inappreview"
cordova-background-geolocation-lt 2.14.2 "BackgroundGeolocation"
cordova-clipboard 1.2.1 "Clipboard"
cordova-fabric-plugin 1.1.14-dev "cordova-fabric-plugin"
cordova-launch-review 3.1.1 "Launch Review"
cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-cocoalumberjack 0.0.4 "CocoaLumberjack"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-filepicker 1.1.5 "File Picker"
cordova-plugin-fingerprint-aio 1.5.0 "FingerprintAllInOne"
cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin"
cordova-plugin-httpd 0.9.2 "CorHttpd"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 3.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-ssh-tunnel 1.1.0 "SSHTunnel"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-taptic-engine 2.1.0 "Taptic Engine"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.4 "SocialSharing"
cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin"
es6-promise-plugin 4.2.2 "Promise"
  • Dev machine OS and version, e.g.
ProductName:	Mac OS X
ProductVersion:	10.14.2
BuildVersion:	18C54

Runtime issue

  • Device details
    • iPhone XS MAX
  • OS details
    • iOS 12.1.2

iOS build issue:

  • Node JS version
    • v10.15.0
  • XCode version
    • 10.1

If using an Ionic Native Typescript wrapper for this plugin:

  • Ionic environment info
Ionic:

   ionic (Ionic CLI)             : 4.7.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.1
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.0.0, (and 22 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/bushev/Library/Android/sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v10.15.0 (/usr/local/bin/node)
   npm               : 6.5.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61
  • Installed Ionic Native modules and versions
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]
├─┬ @ionic-native/[email protected]

Rating dialog requires iOS 10.3+

Receiving "Rating dialog requires iOS 10.3+" error when calling the LaunchReview.rating() function on a iOS device running 10.3.1.

New 4.0.0 rating(result) is returning 0, dialog not opening.

Bug report

CHECKLIST

  • I have reproduced the issue using the example projector provided the necessary information to reproduce the issue.
  • I have read the documentation thoroughly and it does not help solve my issue.
  • I have checked that no similar issues (open or closed) already exist.
    Bring attention back to: #25 - I posted more details at bottom of this closed issue with what is happening.

Current behavior:

This is breaking on v4.0.0 on Android versions 7 - 10, but older version 3.1.1 still works on v7 - 10. I don't have an Android 11 device (yet) to test on so I don't know the behavior for v11.

Result is returning value 0, not opening dialog but also causing external app review to not launch.
LaunchReview.rating(function(result) { // result = 0, unexpected }

Expected behavior:

On Android, using old v3.1.1 advanced code or the new v4.0.0 advanced code, rating result returns value while also not prompting for dialog box or launching external app store review. Condition 0 is not an expected response.

Steps to reproduce:

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

LaunchReview.rating(function(result){
     console.log(result) ;   // value is 0, android does nothing.
     if(cordova.platformId === "ios"){
        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");  // console msg prints, but nothing happens.
    } 
    
},function(err){
    console.log("Error opening rating dialog: " + err);
});

To fix, I had to add:

    } else if(cordova.platformId === "android"){
        console.log("Rating dialog displayed");   // but nothing happens
        if (result === 0) {
           // call extneral launch function
           $scope.rateAppLaunch() ;
        }
    } 

Pass success/error result to rating() "dismissed" event

Thanks for your diligent work on this plugin!

As it stands, the dismissed event triggered by the rating() method doesn't appear to differentiate between cancellations and successful ratings. I don't suppose it'd be feasible to pass an explicit result?

I haven't yet checked the appropriate HealthKit documentation, but assuming this is feasible I'd be happy to submit a PR.

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.