getAndroidStoreVersion method

Future<bool?> getAndroidStoreVersion({
  1. String? country,
  2. String? language,
})

Android info is fetched by parsing the html of the app store page.

Implementation

Future<bool?> getAndroidStoreVersion(
    {String? country, String? language}) async {
  final id = _packageInfo!.packageName;
  final playStore = HcPlayStoreSearchAPI(client: client);
  playStore.debugLogging = debugLogging;
  final response =
      await (playStore.lookupById(id, country: country, language: language));
  if (response != null) {
    _appStoreVersion ??= playStore.version(response);
    _appStoreListingURL ??=
        playStore.lookupURLById(id, language: language, country: country);
    _releaseNotes ??= playStore.releaseNotes(response);
    final mav = playStore.minAppVersion(response);
    if (mav != null) {
      minAppVersion = mav.toString();
      if (debugLogging) {
        if (kDebugMode) {
          print('hcUpgrade: PlayStoreResults.minAppVersion: $minAppVersion');
        }
      }
    }
  }

  return true;
}