huawei_in_app_update 0.1.0+1 copy "huawei_in_app_update: ^0.1.0+1" to clipboard
huawei_in_app_update: ^0.1.0+1 copied to clipboard

outdated

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().

void checkForUpdate() async {
    if (Platform.isAndroid) {
        try {
            final upgradeInfo = await HuaweiInAppUpdate.checkForUpdate();
            if (upgradeInfo.updateAvailable) {
                HuaweiInAppUpdate.showUpdateDialog();
            }
        } 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.

7
likes
0
pub points
78%
popularity

Publisher

verified publisherdomago.dev

Unofficial flutter plugin for accessing Huawei App Update Official API.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on huawei_in_app_update