checkForUpdates static method
Checks for app update in stores, taking into account the local version.
appleIdunique identifier in Apple Store, if null, we will use your package name.playStoreIdunique identifier in Play Store, if null, we will use your package name.country, region of store, if null, we will use 'us'.
example
await AppVersionUpdate.checkForUpdates(
appleId: '123456789',
playStoreId: 'com.example.app',
country: 'br')
.then((data) async {
if (data.canUpdate!) {
//action...
});
Implementation
static Future<AppVersionResult> checkForUpdates({
String? appleId,
String? playStoreId,
String? country = 'us',
}) async {
AppVersionData data = await fetchVersion(
playStoreId: playStoreId, appleId: appleId, country: country);
return AppVersionResult(
canUpdate: data.canUpdate,
storeUrl: data.storeUrl,
storeVersion: data.storeVersion,
platform: data.targetPlatform);
}