https://github.com/vinodbaste/app_update
Allow users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes.
https://github.com/vinodbaste/app_update
android appstore dart flutter inappupdate ios library package playstore plugin update
Last synced: 3 months ago
JSON representation
Allow users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes.
- Host: GitHub
- URL: https://github.com/vinodbaste/app_update
- Owner: vinodbaste
- License: apache-2.0
- Created: 2022-09-17T05:54:16.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-11T06:49:48.000Z (almost 3 years ago)
- Last Synced: 2025-02-12T10:18:35.664Z (8 months ago)
- Topics: android, appstore, dart, flutter, inappupdate, ios, library, package, playstore, plugin, update
- Language: C++
- Homepage:
- Size: 850 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# App Update alert Plugin
```keep your app users up to date on their devices```[](https://)
[](https://)

[](#license)
[](https://androidweekly.net/issues/issue-326)
[](https://medium.com/codex/image-compresso-13dbfd0445a3)
[](https://github.com/vinodbaste/app_update#readme)With the help of a this Flutter plugin.
* Check if a user has the most recent installation of your app.
* Display a message to the user with a link to the relevant app store page.See more at the [Dart Packages page.](https://pub.dev/packages/app_update_alert)
## Installation
Add `app_update_alert` as [a dependency in your `pubspec.yaml` file.](https://flutter.io/using-packages/)## With Flutter:
```
Run this command:
flutter pub add app_update_alert
```
This will add a line like below to your package's ```pubspec.yaml``````
dependencies:
app_update_alert: ^1.5.5
```
run an implicit ```flutter pub get```## Usage
Create an instance of `AppUpdate` in `main.dart` (or wherever your app is initialised).```Dart
@override
void initState() {
super.initState();
final appUpdate = AppUpdate(
iosPackageName: 'com.your.IOSpackage',
androidPackageName: 'com.your.Androidpackage',
iOSAppStoreCountry: 'in'
);
}
```Your Flutter package identification will be used by the plugin automatically to search the app store.
You can overwrite this identity if your app uses a different one on the Google Play Store or Apple App Store by giving values for `androidPackageName` and/or `iosPackageName.`*For iOS:* You must specify `iOSAppStoreCountry` to the two-letter country code of the Software Store you want to search if your app is only accessible outside the India. A list of ISO Country Codes can be found at http://en.wikipedia.org/wiki/ISO 3166-1 alpha-2.
### Quickstart
Calling `showUpdateAlert` with your app's `BuildContext` and other optional parameters which will check if the app can be updated, and will automatically display a platform-specific alert that the user can use to go to the app store.```Dart
@override
void initState() {
super.initState();
final appUpdate = AppUpdate(
iosPackageName: 'com.your.IOSpackage',
androidPackageName: 'com.your.Androidpackage',
iOSAppStoreCountry: 'in'
);
//showUpdateAlert
appUpdate.showUpdateAlert(context: context);
}
```
*Note:* The parameters such as `iosPackageName`, `androidPackageName` are non-mandatory fields and can only be overwritten if the app package's differ from store versions.# showUpdateAlert dialog with optional parameters and dialog dismissal
To change the appearance and behavior of the update dialog, you can `showUpdateAlert`
optionally provide `dialogTitle: String`, `dialogText: String`, `updateButtonText: String`, `allowDismissal: bool`,
`dismissButtonText: String`, and `dismissAction: VoidCallback` parameters.
```Dart
appUpdate.showUpdateAlert(context: context,
dialogTitle: dialogTitle,
dialogText: dialogText,
updateButtonText: updateButtonText,
allowDismissal: true,
dismissButtonText: dismissButtonText,
dismissAction: dismissAction
);
```# showUpdateAlert dialog without dialog dismissal
To change the appearance and behavior of the update dialog, you can `showUpdateAlert`
optionally provide `dialogTitle: String`, `dialogText: String`, `updateButtonText: String`, `allowDismissal: bool`, parameters.
```Dart
appUpdate.showUpdateAlert(context: context,
dialogTitle: dialogTitle,
dialogText: dialogText,
updateButtonText: updateButtonText,
allowDismissal: false,
);
```# showUpdateAlert dialog with optional VoidCallback
When dialog dismissal is allowed and to perform/ execute any functions on `dismissButtonText` or on dialog dismiss use the `dismissAction`.
```Dart
void callBackFunction() {
print('dismissAction called');
}appUpdate.showUpdateAlert(context: context,
dialogTitle: dialogTitle,
dialogText: dialogText,
updateButtonText: updateButtonText,
allowDismissal: true,
dismissButtonText: dismissButtonText,
dismissAction: callBackFunction()
);
```# Force update dialog
Calling `forceAppVersion` with your app's greater version will check if the app can be updated, and will automatically display a platform-specific alert that the user can use to go to the app store.
```Dart
final appUpdate = AppUpdate(
iosPackageName: 'com.your.IOSpackage',
androidPackageName: 'com.your.Androidpackage',
iOSAppStoreCountry: 'in',
forceAppVersion: '1.0.1'
);
```# Platform Support
```
ANDROID - ✅ Yes
IOS - ✅ Yes
LINUX - ❌ No
MACOS - ❌ No
WEB - ❌ No
WINDOWS - ❌ No
```**If you find this library useful, please consider starring this repository from the top of this page.**
[](#)# License
```
Copyright [2022] [Vinod Baste]Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```