huawei_in_app_update 1.2.2 copy "huawei_in_app_update: ^1.2.2" to clipboard
huawei_in_app_update: ^1.2.2 copied to clipboard

PlatformAndroid

Unofficial flutter plugin for accessing Huawei App Update Official API.

huawei_in_app_update #

This flutter plugin project use official Huawei App Update API to check update from AppGallery. Please note that this plugin for Android use only.

Prerequisite #

You must add the AppGallery Connect configuration file of your app to your project before you run it.

Usage #

Calling HuaweiInAppUpdate.checkForUpdate() will return UpgradeInfo. You may use upgradeInfo.updateAvailable to check if there is an update available. If update is available, you may show a update dialog using HuaweiInAppUpdate.showUpdateDialog(). If force specify as true, dialog will not dismissable and back button will not pop the dialog.

void checkForUpdate() async {
    if (Platform.isAndroid) {
      try {
        final upgradeInfo = await HuaweiInAppUpdate.checkForUpdate();
        if (upgradeInfo.updateAvailable) {
          HuaweiInAppUpdate.showUpdateDialog(
            context: context,
            force: false,
          );
        }
      } on PlatformException catch (e) {
        showErrorDialog(e.code, e.message);
      }
    } else {
      showErrorDialog('IOS_NOT_SUPPORTED', 'iOS device is not supported');
    }
  }

If you would like to have a different app update presentation in your app, you may try to create your own custom widget design using the information provided from UpgradeInfo.

11
likes
130
points
111
downloads

Publisher

verified publisherdomago.dev

Weekly Downloads

Unofficial flutter plugin for accessing Huawei App Update Official API.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

flutter, url_launcher

More

Packages that depend on huawei_in_app_update

Packages that implement huawei_in_app_update