airbuild 0.4.1
airbuild: ^0.4.1 copied to clipboard
AirBuild Distribution SDK for Flutter. Check for new binary builds from AirBuild install links and prompt testers to install them, plus an optional CodePush module for OTA Dart patches.
Changelog #
0.4.1 - 2026-10-23 #
Fixed #
checkForUpdatesno longer fails against servers that returnlatestBuildNumber/fileSizeBytesas quoted strings —UpdateInfonow tolerantly parses ints, doubles, and numeric strings.AirBuildClientnow catchesErrortypes (e.g.TypeErrorfrom malformed payloads), not justExceptions — a bad response degrades to "no update" instead of propagating out of the SDK.
0.4.0 - 2026-10-23 #
Added #
AirBuild.installUpdate(update, {onProgress})— the platform install flow is now public, so custom update UIs (e.g.showUpdateDialog'sonUpdatecallback, or your own bottom sheet after a headlesscheckForUpdates) can reuse it instead of reimplementing download + install. On Android it downloads the APK inside the app and installs it; on iOS it opens the install URL in Safari.onProgressreports APK download progress (received/totalbytes) for custom progress UIs. Reports the samedownload_started/install_startedanalytics as the built-in dialog.- Android 12+ (API 31+): APK updates now install through a
PackageInstallersession withUSER_ACTION_NOT_REQUIRED— when the app is its own installer of record, the update applies with no system confirmation sheet. OtherwiseInstallResultReceiverauto-launches the normal install sheet. DeclaresUPDATE_PACKAGES_WITHOUT_USER_ACTION. - Example app: "Check silently (custom dialog)" button demonstrating a
headless
checkForUpdates,UpdateInfoinspection,showUpdateDialogwith custom callbacks, and a live download-progress bar.
Changed #
- Android 11 and below keep the previous
ACTION_VIEW+FileProviderinstall path; the session path is also skipped on any session failure (same UX as before). AirBuild.installUpdatenow reportsdownload_failed/install_failedanalytics events on failure, validates the downloaded file is an APK (PK/ZIP signature) before installing, removes a staleairbuild_update.apkbefore each download, and validates the iOS install URL scheme (https/itms-services) before launching.- On Android 8+ (API 26+)
installApkfirst checkscanRequestPackageInstalls()— when the "install unknown apps" privilege hasn't been granted, the system settings screen for your app opens and the call fails with a clear error instead of silently failing. AirBuildClient.downloadApkdeletes the partial file when the stream fails mid-download, drains the response body on non-200s, and a throwingonProgresscallback can no longer abort the download.
Fixed #
- Plugin
android/build.gradlenow applieskotlin-android— without it the Kotlin plugin sources couldn't compile in host app builds.
0.3.1 - 2026-10-22 #
Fixed #
- README updated: Install snippet now shows the correct
^0.3.0constraint.
0.3.0 - 2026-10-20 #
Added #
AirBuildCodePushOverlay— a drop-in widget that runs the whole manual CodePush lifecycle: checks on launch, on app resume, and on a timer (default 4h), downloads available patches, and shows a "restart to apply" banner. Configurable viaAirBuildCodePushConfig(channel,checkOnLaunch/checkOnResume/checkInterval,onRestart,bannerBuilder,onUpdateReady). The banner re-appears only when a different patch is staged, so dismissed prompts don't nag.showDebugBaroverlay option — a thin status strip showing the live CodePush state for internal/dev builds.disableOnPlayStoreInstallsonAirBuildCodePushandAirBuildCodePushConfig— skips patch checks/downloads when the running build was installed from Google Play (com.android.vending), so OTA patches apply only to AirBuild-distributed/sideloaded installs. Fails open on undeterminable install sources. Does not affect the engine'sauto_updateboot thread — combine withauto_update: falsefor a complete opt-out.installerPackageName()/isPlayStoreInstall()helpers (airbuild_code_push.dartexport) for reading the Android install source. NewgetInstallerPackageNamemethod on the Android plugin's method channel; no iOS change needed.AirBuildCodePushnow accepts injectableupdater/playStoreInstallProbe(test-only seams).- Widget + unit tests covering the overlay lifecycle, banner dismiss/re-show behavior, resume checks, and Play-Store gating (33 tests total).
0.2.0 - 2026-09-12 #
Added #
- New
airbuild_code_push.dartlibrary:AirBuildCodePush, a thin wrapper around Shorebird'sshorebird_code_pushpackage (checkForUpdate(),update(),currentPatch(),nextPatch(),isAvailable) that maps AirBuild channel names ("production","staging", custom) onto Shorebird'sUpdateTrackconcept. showRestartBanner()— aMaterialBanner-based prompt for telling testers a patch was downloaded and needs a restart to apply.- Re-exports
Patch,UpdateStatus,UpdateTrack, and related exceptions fromshorebird_code_pushfor convenience. example/lib/main.dartnow includes a CodePush usage example alongside the existing binary-distribution example.INTERNET+REQUEST_INSTALL_PACKAGESpermissions in the plugin'sAndroidManifest.xmlso the merged manifest of host apps can download and self-install APKs on Android 8+.checkForUpdatessends the app's build number as?build=so the server can distinguish same-version builds (e.g.1.0.0+1vs1.0.0+2) and stops re-prompting devices already on the latest build. Auto-detected viapackage_info_plus;currentBuildNumberoverrides it.- Unit tests for
AirBuildConfig,UpdateInfo, byte-size formatting, and the CodePush channel→UpdateTrackmapping (20 tests). - GitHub Actions CI workflow (
flutter analyze,flutter test).
Changed #
- Minimum SDK raised to Dart
>=3.5.4/ Flutter>=3.24.5(from>=2.17.0/>=3.0.0), to satisfyshorebird_code_push's own minimum constraints. Only affects apps that import the newairbuild_code_push.dartlibrary —airbuild.dart(binary distribution) is otherwise unchanged. - Fixed a pre-existing missing import (
package:flutter/services.dart) that causedMethodChannel/MissingPluginExceptionanalysis errors inairbuild.dart.
0.1.0 - 2026-09-02 #
Added #
- Initial release of the AirBuild Flutter Distribution SDK.
AirBuild.configure(distributionKey, baseUrl?)for one-time setup.AirBuild.checkForUpdates(context, currentVersion)to check for new builds.- Default update dialog with app icon, version, release notes, and Update/Later buttons.
- Android: APK download + system installer via platform channel and FileProvider.
- iOS: Opens install URL in Safari via url_launcher.
- Analytics event reporting (prompt shown, accepted, declined, download started, install started).
- Example app in
example/.