launchStoreListing method

Future<bool> launchStoreListing({
  1. bool iosWriteReview = true,
})

Launches the URL for reviewing.

  • Android: If play store installed, opens play store via market: url, otherwise launches https://play.google.com/
  • iOS: Open itunes.apple.com - set iosWriteReview to true to use ?action=write-review

Implementation

Future<bool> launchStoreListing({bool iosWriteReview = true}) async {
  if (Platform.isIOS) {
    final appId = await getIosAppId();
    // https://developer.apple.com/documentation/storekit/skstorereviewcontroller/requesting_app_store_reviews?language=objc
    final urlPostfix = iosWriteReview ? '?action=write-review' : '';
    return await urlLaunch('${getIosStoreListing(appId)}$urlPostfix');
  } else {
    final appId = await _getPackageName();
    if (await urlCanLaunch('market://')) {
      return await urlLaunch('market://details?id=$appId');
    } else {
      return await urlLaunch(getAndroidStoreListing(appId));
    }
  }
}