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.
306 stars 78 forks source link

Neither openStoreListing or requestReview are triggered on iOS in release #74

Closed Milvintsiss closed 1 year ago

Milvintsiss commented 1 year ago

Hello, In my app users can trigger review with a button in the settings page. When they do I check if the requestReview() is available with isAvailable() method. If not I trigger openStoreListing() method. All of this work great when installing via xcode, but when the app is installed via the AppStore, neither openStoreListing or requestReview are triggered (seems to be only the case when user has already rated the app but I have not enough feedbacks to confirm this) and nothing appears on screen.

Here a snippet of the code used:

final inAppReview = InAppReview.instance;
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();

// true if never requested or last request is over a month old
bool androidInAppReviewAvailable = true;
if (sharedPreferences.getInt(lastReviewAndroidKey) != null)
  androidInAppReviewAvailable = DateTime.fromMillisecondsSinceEpoch(
    sharedPreferences.getInt(lastReviewAndroidKey)!,
  ).isBefore(DateTime.now().addMonths(nb: -1));

if ((androidInAppReviewAvailable || !Platform.isAndroid) &&
    await inAppReview.isAvailable()) {
  if (Platform.isAndroid)
    sharedPreferences.setInt(
      lastReviewAndroidKey,
      DateTime.now().millisecondsSinceEpoch,
    );
  inAppReview.requestReview();
} else {
  inAppReview.openStoreListing(appStoreId: appStoreId);
}
britannio commented 1 year ago

For such a use case, the official documentation suggests that openStoreListing() should always be triggered. isAvailable() is slightly confusing, it can return true but this doesn't guarantee the review pop-up will appear. It's more to check if the device is running a suitable Android or iOS version.