When a newer app version is available in the app store, or manual version created an alert prompt is displayed.
- Show version info and call to action
- Can enforce a minimum app version
- Supports Appcast (Build in feature in App builder plugin)
Requirement
- Cirilla
v4.0.0
or above - App builder
v4.0.0
or above
Platform Support
iOS | ✅ |
Android | ✅ |
Widgets
There are three buttons displayed to the user: IGNORE, LATER, and UPDATE NOW.
Tapping | |
IGNORE | Prevents the alert from being displayed again for that version. |
LATER | Button just closes the alert allowing the alert to be displayed sometime in the future. |
UPDATE NOW | Button takes the user to the App Store (iOS) or Google Play Store (Android) where the user is expected to initiate the update process. |
Setting App Builder ( requirement )
Configure source code
Adding package
- Copy upgrade_prompt package and add to packages folder in cirilla project.
- Import package in
cirilla/pubspec.yaml
Example:
upgrade_prompt:
path: ./packages/upgrade_prompt
Open file
cirilla/lib/hooks/wrap_home_child.dart
Step 1:
Import:
import 'package:upgrade_prompt/upgrade_prompt_alert.dart';
import 'package:cirilla/service/constants/endpoints.dart';
Step 2:
Add the code snippets to the wrapHomeChild function:
const String appcastURL = "${Endpoints.restUrl}/app-builder/v1/upgrader";
final isTopOfNavigationStack = ModalRoute.of(context)?.isCurrent ?? false;
return UpgradePromptAlert(
enableUpgradePromptAlert: isTopOfNavigationStack,
appcastURL: appcastURL,
durationUntilAlertAgain: const Duration(seconds: 30),
child: child,
);
Here are the custom parameters:
- canDismissDialog: can alert dialog be dismissed on tap outside of the alert dialog, which defaults to
false
- cupertinoButtonTextStyle: the text style for the cupertino dialog buttons, which defaults to
null
- showIgnore: hide or show Ignore button, which defaults to
false
- showLater: hide or show Later button, which defaults to
true
- showReleaseNotes: hide or show release notes, which defaults to
true
- durationUntilAlertAgain: duration until alerting user again, which defaults to
3 days