app_updater 2.1.0
app_updater: ^2.1.0 copied to clipboard
A comprehensive Flutter package to check for app updates and display platform-native dialogs. Supports iOS, Android, macOS, Windows, and Linux with release notes, analytics, GitHub releases, Firebase [...]
Changelog #
All notable changes to this project will be documented in this file.
2.1.0 #
New Features #
- Private GitHub Repository Support: Check for updates from private GitHub repositories
- New
githubTokenparameter for simple token-based authentication — just pass your GitHub PAT - New
githubHeadersparameter for custom HTTP headers (GitHub Enterprise, advanced auth) githubTokensets theAuthorizationheader automatically;githubHeaderscan override it- Fully backward compatible — public repositories continue to work without any changes
- New
Use Cases #
- Internal / enterprise Flutter apps using private GitHub repositories
- Closed-source applications distributed outside Play Store / App Store
- GitHub Enterprise environments requiring custom headers
Example #
// Simple — just pass your token
final appUpdater = AppUpdater.configure(
githubOwner: 'mycompany',
githubRepo: 'private-app',
githubToken: 'ghp_xxxxxxxxxxxxx',
);
// Advanced — full header control
final appUpdater = AppUpdater.configure(
githubOwner: 'mycompany',
githubRepo: 'private-app',
githubHeaders: {
'Authorization': 'token ghp_xxxxxxxxxxxxx',
'Accept': 'application/vnd.github+json',
},
);
2.0.0 #
New Features #
-
Release Notes Display: Automatically fetch and display release notes/changelogs in update dialogs
- Fetches from App Store (iOS/macOS), Flathub (Linux), GitHub Releases, and custom endpoints
- New
showReleaseNotesparameter inshowUpdateDialog()(enabled by default) - Release notes are displayed in a scrollable container within the dialog
-
Update Frequency Control: Prevent checking for updates too frequently
- New
checkFrequencyparameter inAppUpdaterConfig(e.g.,Duration(days: 1)) checkForUpdate(respectFrequency: false)to bypass frequency check- Automatically tracks last check time in preferences
- New
-
Background/Silent Checking: Check for updates without blocking the UI
- New
startBackgroundChecking(Duration interval)method for periodic checks - New
stopBackgroundChecking()method to cancel background checks - New
updateStreamto listen for update notifications - New
performBackgroundCheck()for single background check - New
dispose()method to clean up resources
- New
-
Force Update by Minimum Version: Require users to update if below a version
- New
minimumVersionparameter inAppUpdaterConfig - Support for
minimumVersionin custom JSON/XML endpoints - New
requiresForceUpdategetter onUpdateInfo - Automatic
isPersistent: truebehavior when force update is required
- New
-
Update Urgency Levels: Communicate update importance to users
- New
UpdateUrgencyenum:low,medium,high,critical - Dialog icon and color automatically change based on urgency
- Support for
urgencyfield in custom endpoints and Firebase Remote Config
- New
-
Analytics & Callbacks: Track user interactions with update dialogs
- New
onAnalyticsEventcallback inAppUpdaterConfig - New
UpdateAnalyticsEventclass withtoMap()for analytics services - Predefined event names:
dialogShown,updateAccepted,updateDeclined, etc. - Track impressions and dismissals via
UpdatePreferences
- New
-
GitHub Releases Support: Check for updates from GitHub releases
- New
githubOwnerandgithubRepoparameters inAppUpdaterConfig - New
githubIncludePrereleasesto include beta/prerelease versions - Automatically fetches version, release notes, and download URL
- New
GitHubReleaseclass for release metadata
- New
-
TestFlight Support (iOS): Support beta updates via TestFlight
- New
testFlightEnabledparameter inAppUpdaterConfig - New
testFlightUrlfor custom TestFlight URLs - New
openTestFlight()method to open TestFlight - New
getTestFlightUrl()method
- New
-
Firebase Remote Config Integration: Dynamic version control via Firebase
- New
firebaseRemoteConfigEnabledparameter - New
FirebaseRemoteConfigSettingsclass for key configuration - New
firebaseConfigFetchercallback to fetch values - Support for all update parameters (version, minimumVersion, urgency, etc.)
- New
-
Localization / i18n: Built-in support for translations
- New
UpdateStringsclass with all dialog text - New
stringsparameter inAppUpdaterConfig - Message placeholders:
{currentVersion},{latestVersion} - Includes all button text, titles, and error messages
- New
-
Enhanced UpdateInfo: More metadata about updates
- New
releaseNotesproperty for changelog text - New
urgencyproperty for update priority - New
minimumVersionproperty - New
isMandatoryproperty - New
releaseDateproperty - New
updateSizeBytesandformattedUpdateSizeproperties - New
requiresForceUpdatecomputed property - New
copyWith()method
- New
Improvements #
-
Enhanced UpdatePreferences: New preference methods
getLastCheckTime()/setLastCheckTime()for frequency controlshouldCheckForUpdate(Duration)for frequency checkinggetUpdateImpressions()/incrementUpdateImpressions()for analyticsgetUpdateDismissals()/incrementUpdateDismissals()for analytics
-
Better Custom Endpoint Support: Extended JSON/XML schema
- Support for
releaseNotes/release_notes/changelogfields - Support for
minimumVersion/minimum_versionfields - Support for
urgencyfield (low, medium, high, critical) - Support for
mandatory/force_updatefields
- Support for
-
Improved Dialog UI: Visual enhancements
- Urgency-based icon and color theming
- Release notes section with scrollable content
- Update size display when available
- Better handling of long content
-
Code Quality: Internal improvements
- Comprehensive documentation comments on all public APIs
- Better async/await handling with mounted checks
- Proper resource cleanup with
dispose()method
Breaking Changes #
- None - all existing APIs remain backward compatible
1.1.2 #
- Maintenance release with dependency updates.
1.1.1 #
- Fixed an issue where the "Do Not Ask Again" preference was not being saved correctly on some platforms.
- Improved version comparison logic to handle edge cases with pre-release versions.
- Updated dependencies to their latest versions for better compatibility and security.
1.1.0 #
- Removed outdated migration section from README.
- Documentation cleanup.
1.0.9 #
- Fixed App Store & Play Store version scraping to handle recent changes in store layouts.
- Improved compatibility with latest Flutter stable release.
- Minor performance optimizations in version checking logic.
1.0.8 #
- Fixed a bug where the "Do Not Ask Again" preference was not being respected on some platforms.
- Improved error handling when fetching version info from custom endpoints.
- Updated documentation with examples for new features introduced in 1.0.7.
1.0.7 #
Breaking Changes #
- Replaced
checkAppUpdate()function withAppUpdaterclass for better architecture. - New class-based API: Create an
AppUpdaterinstance and call methods on it. - Converted to pure Dart package (removed unnecessary native code).
New Features #
-
Full Desktop Support:
- macOS App Store version checking and store opening.
- Microsoft Store version checking and store opening.
- Linux Snap Store version checking and store opening.
- Linux Flathub version checking and store opening.
-
Platform-Specific Dialog Styles:
UpdateDialogStyle.adaptive- Automatically selects the best style for the current platform.UpdateDialogStyle.material- Material Design 3 style (Android).UpdateDialogStyle.cupertino- Native iOS/macOS style with SF Symbols.UpdateDialogStyle.fluent- Fluent Design style (Windows).UpdateDialogStyle.adwaita- GNOME/Adwaita style (Linux).
-
Persistent Dialogs:
isPersistent: true- Creates a non-dismissible dialog for critical/forced updates.- User cannot dismiss with back button or tap outside.
-
"Do Not Ask Again" Feature:
showDoNotAskAgain: true- Shows option to never show update dialog again.- Uses
SharedPreferencesto remember user's choice. UpdatePreferences.clearAll()- Reset all stored preferences.
-
Skip Version Feature:
showSkipVersion: true- Shows option to skip the current version.- Won't show dialog again for the skipped version.
UpdatePreferences.clearSkippedVersion()- Clear skipped version.
-
Custom Update Endpoints:
customXmlUrl- Fetch version info from custom XML endpoint.customJsonUrl- Fetch version info from custom JSON endpoint.
-
New
AppUpdaterClass:AppUpdater.configure()- Factory constructor with individual parameters.AppUpdater(config)- Constructor withAppUpdaterConfigobject.checkForUpdate()- Check for updates without showing dialog.showUpdateDialog()- Show update dialog with custom options.checkAndShowUpdateDialog()- Combined check and show dialog.openStore()- Open the appropriate app store.getStoreUrl()- Get the store URL for the current platform.
-
New
UpdatePreferencesClass:isVersionSkipped(version)- Check if a version is skipped.skipVersion(version)- Skip a specific version.isDoNotAskAgain()- Check "do not ask again" preference.setDoNotAskAgain(value)- Set "do not ask again" preference.clearAll()- Clear all update preferences.clearSkippedVersion()- Clear only the skipped version.
-
New
AppUpdaterConfigClass:- Configuration object for
AppUpdaterwith all platform IDs. iosAppId- iOS App Store app ID.macAppId- macOS App Store app ID.androidPackageName- Android package name (auto-detected if not provided).microsoftProductId- Microsoft Store product ID.snapName- Snap Store package name.flathubAppId- Flathub app ID.linuxStoreType- Choose betweenLinuxStoreType.snaporLinuxStoreType.flathub.
- Configuration object for
-
UpdateInfo Class: Returns detailed update information including
currentVersion,latestVersion,updateUrl, andupdateAvailable.
Improvements #
- Improved dialog UI with icons and better styling for each platform.
- Better
mountedchecks to prevent BuildContext issues. - Added
toString()method toUpdateInfofor easier debugging. - Proper semantic version comparison instead of simple string comparison.
- Platform-appropriate dialogs (Cupertino for iOS/macOS, Material for others).
- Cached
PackageInfofor better performance. - Better error handling with debug logging.
- Added pub.dev topics for better discoverability.
Dependencies #
- Updated to latest dependency versions:
package_info_plus: ^9.0.0flutter_lints: ^6.0.0url_launcher: ^6.3.1shared_preferences: ^2.3.4
- Updated minimum SDK requirement to Dart 3.5.0 and Flutter 3.22.0.
1.0.6 #
- Bug fixes & improvements.
1.0.5 #
- Dependencies update.
1.0.4 #
- isDismissible parameter added.
- noUpdateCallback parameter added.
1.0.3 #
- Documentation update.
1.0.2 #
- Documentation update.
1.0.1 #
- Documentation update.
1.0.0 #
- Initial release.
- Prebuilt adaptive dialogs.
- Customizable adaptive dialogs.