checkVersion static method

Future<PlayxVersionUpdateResult<PlayxVersionUpdateInfo>> checkVersion({
  1. String? localVersion,
  2. String? newVersion,
  3. String? minVersion,
  4. bool? forceUpdate,
  5. String? googlePlayId,
  6. String? appStoreId,
  7. String country = 'us',
  8. String language = 'en',
})

Check the version of the app on Google play store in Android Or App Store in IOS Takes localVersion : which is the current version of the app, If not provided It will get it from the app information. If newVersion is provided it will compare it with the current version. If not it will get it from the store information. forceUpdate whether to force the update or not. If minVersion is provided it will compare it with the current version. If current version is lower than the minimum version it will return forceUpdate as true to force the update if forceUpdate is not set. googlePlayId,appStoreId the app package or bundle id. If not provided it will get it from the app information. country, language decides which country and language we will get app information from the store. default is 'us' and 'en'. returns PlayxVersionUpdateResult : which on success returns PlayxVersionUpdateInfo which contains information about the current version and the latest version. and whether the app should update of force update to the latest version. on Error returns PlayxVersionUpdateError which contains information about the error.

Implementation

static Future<PlayxVersionUpdateResult<PlayxVersionUpdateInfo>> checkVersion({
  String? localVersion,
  String? newVersion,
  String? minVersion,
  bool? forceUpdate,
  String? googlePlayId,
  String? appStoreId,
  String country = 'us',
  String language = 'en',
}) async {
  return _versionChecker.checkVersion(
    localVersion: localVersion,
    newVersion: newVersion,
    minVersion: minVersion,
    forceUpdate: forceUpdate,
    googlePlayId: googlePlayId,
    appStoreId: appStoreId,
    country: country,
    language: language,
  );
}