UpdateStoreChecker class

UpdateStoreChecker class

This class allows checking for updates in the app store where the app was installed from. It supports App Store, Google Play, Huawei AppGallery, and RuStore.

Example usage:

final updateChecker = UpdateStoreChecker(
  iosAppStoreId: 564177498,
  androidAppGalleryId: 'C101104117',
  androidAppGalleryPackageName: 'com.vkontakte.android',
  androidRuStorePackage: 'com.vkontakte.android',
  androidGooglePlayPackage: 'com.vkontakte.android',
);

// Check update
bool isUpdateAvailable = await updateChecker.checkUpdate();

// Get version from Store
String storeVersion = await updateChecker.getStoreVersion();

// Open Store Link
await updateChecker.update();

Constructors

UpdateStoreChecker({int? iosAppStoreId, String? iosAppStoreCountry, String? androidGooglePlayPackage, String? androidAppGalleryId, String? androidAppGalleryPackageName, String? androidRuStorePackage, bool forceNoCache = false})
Constructor for UpdateStoreChecker

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkUpdate({StoreType? store, String? storeVersion}) → Future<bool>
Checks if an update is available for the app in the store.
getInstalledVersion() → Future<String>
return the current installed version of the app
getStoreAndLocalVersions({StoreType? store}) → Future<Map<String, Object?>>
getStoreType() → Future<StoreType?>
Determines the store type from where the app was installed.
getStoreVersion({StoreType? store}) → Future<String>
Retrieves the current version of the app in the store.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
update({StoreType? store}) → Future<bool>
Opens the app's store page to update the app.

Operators

operator ==(Object other) → bool
The equality operator.
inherited