dpa99c / cordova-launch-review

Cordova/Phonegap plugin for iOS and Android to assist in leaving user reviews/ratings in the App Stores
71 stars 26 forks source link

Error cases for LaunchReview.rating() #2

Closed jonathankau closed 6 years ago

jonathankau commented 7 years ago

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.

dpa99c commented 7 years ago

Although I haven't tested this scenario, I am almost certain that the request will fail silently in these cases.

The StoreKit SDK function which requests the rating dialog returns no result, hence the only way it could indicate an error is by throwing an exception and this is not a methodology which iOS APIs commonly subscribe to.

So my prediction is that if the user has already rated the app or dismissed the prompt 3 times, there will be no abnormal response from the iOS API and therefore this plugin's success callback will be invoked.

This is something that I will confirm by testing and if so will add a caveat to the documentation for the plugin.

dpa99c commented 7 years ago

This appears to only be testable if the plugin is included in a release build downloaded via the App Store.

In debug builds or locally-installed release builds, the popup continues to appear no matter how many times you dismiss it. The "Submit" button for the popup is also disabled so you cannot actually submit the rating.

Since I don't currently have a live app in the App Store using this functionality, I'm not able to confirm my assumptions above.

ScottMBerger commented 7 years ago

I have an app live with this and that seems to be the case. So after it is used 3 times I have a button that does nothing. Would be nice if we had a way to fallback to going to the review page in this case.

Here is the app for reference. https://itunes.apple.com/us/app/sleep-orbit-relaxing-3d-sound-white-noise-asmr/id1215043393?ls=1&mt=8

dpa99c commented 7 years ago

I've tested this in a live app and, as expected, the StoreKit API function fails silently in the error cases: no exception thrown, no error code returned. So this plugin has no way to know if the dialog was successfully shown or not. On that basis, for now, I think the best that can be done is to document this as a caveat.

However! I've recently been doing some automated device testing with Appium and using the Appium Inspector to find native elements using XPaths. So it just occurs to me whether something similar could be done to detect the presence of the dialog programmatically from within the target app: i.e. have the plugin use an XPath query to confirm the presence of the native dialog. Will look into this...

ScottMBerger commented 7 years ago

Please let me know if you have found anything new out about this

dpa99c commented 7 years ago

@ScottMBerger I did find a possible solution which involves checking if the dialog UI element is present. However, to do so required indirectly referencing the publicly-inaccessible class name of the review dialog. This goes against Apple guidelines, so may lead to rejection during review. However, it might be possible to justify the usage to Apple reviewers in this case.

I might go ahead and add the functionality, but leave it switched off by default. Those willing to try it can turn it on and submit for Apple review at their own risk.

netvillage commented 7 years ago

Hey, this would be cool if it could be set to launch the app store, but not go right to reviews. Instead go to the app so we could direct them from our phonegap app to 'update this app" when necessary.

dpa99c commented 6 years ago

v3 of the plugin (just published) invokes the success callback for LaunchReview.rating() twice:

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.

Note the major version bump due to backwardly-incompatible API changes. See the updated docs for details and updated examples.

mohitarora2 commented 1 year ago

v3 of the plugin (just published) invokes the success callback for LaunchReview.rating() twice:

  • Once after LaunchReview.rating() is called and the request to show the dialog is successful
  • Once if and when the Rating dialog is actually displayed.

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.

Note the major version bump due to backwardly-incompatible API changes. See the updated docs for details and updated examples.

How to get the cancel button event of the star rating dialog alert?