britannio / in_app_review

A Flutter plugin for showing the In-App Review/System Rating pop up on Android, IOS, and MacOS. It makes it easy for users to rate your app.
327 stars 82 forks source link

`openStoreListing` opens a version of the listing that does not have a rating widget #131

Open lukehutch opened 3 months ago

lukehutch commented 3 months ago

Read testing guidelines

When my app calls openStoreListing, one user reports that the Play Store listing does not allow him to rate the app. However, if he goes straight to the Play Store URL, he gets a different page that does let him rate the app.

(1) The listing after calling openStoreListing:



(2) The listing after visiting the above Play Store URL directly, on the same device:

lukehutch commented 3 months ago

The URL for the launched intent looks the same as the URL I provided for the direct Store link that works:

https://github.com/britannio/in_app_review/blob/d39d86f0f87ba3df8de30af78eebcd1c645c00ba/in_app_review/android/src/main/java/dev/britannio/in_app_review/InAppReviewPlugin.java#L241

Maybe .setData should be used to pass the URL to the browser, rather than passing the URL as the second argument of new Intent(...)?

https://stackoverflow.com/a/5327690/3950982

This is in fact how url_launcher launches URLs on Android:

https://github.com/flutter/packages/blob/b9715b7eac7d97428c4acde94a75dad5a7525668/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncher.java#L89

So I actually replaced openStoreListing with the following in my app:

    await launchUrl(Uri.parse(Platform.isAndroid
        ? 'https://play.google.com/store/apps/details?id=$androidPackageName'
        : 'https://apps.apple.com/us/app/click-social/id$appStoreId'));