in_app_review icon indicating copy to clipboard operation
in_app_review copied to clipboard

Neither openStoreListing or requestReview are triggered on iOS in release

Open Milvintsiss opened this issue 2 years ago • 0 comments

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);
}

Milvintsiss avatar Oct 19 '22 19:10 Milvintsiss