PlayxVersionUpdate class abstract

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

checkVersion({String? localVersion, String? newVersion, String? minVersion, bool? forceUpdate, String? googlePlayId, String? appStoreId, String country = 'us', String language = 'en'}) Future<PlayxVersionUpdateResult<PlayxVersionUpdateInfo>>
Check the version of the app on Google play store in Android Or App Store in IOS Takes localVersion : which is the current version of the app, If not provided It will get it from the app information. If newVersion is provided it will compare it with the current version. If not it will get it from the store information. forceUpdate whether to force the update or not. If minVersion is provided it will compare it with the current version. If current version is lower than the minimum version it will return forceUpdate as true to force the update if forceUpdate is not set. googlePlayId,appStoreId the app package or bundle id. If not provided it will get it from the app information. country, language decides which country and language we will get app information from the store. default is 'us' and 'en'. returns PlayxVersionUpdateResult : which on success returns PlayxVersionUpdateInfo which contains information about the current version and the latest version. and whether the app should update of force update to the latest version. on Error returns PlayxVersionUpdateError which contains information about the error.
completeFlexibleUpdate() Future<PlayxVersionUpdateResult<bool>>
Install a flexible update. When you detect the PlayxDownloadStatus.downloaded state, you need to restart the app to install the update. Unlike with immediate updates, Google Play does not automatically trigger an app restart for a flexible update. This is because during a flexible update, the user has an expectation to continue interacting with the app until they decide that they want to install the update. It is recommended that you provide a notification (or some other UI indication) to inform the user that the update is ready to install and request confirmation before restarting the app. You can check if the app needs to be installed from : isFlexibleUpdateNeedToBeInstalled it's also recommended to use this method on App resume to check whether your app has an update waiting to be installed. If your app has an update in the DOWNLOADED state, prompt the user to install the update. Otherwise, the update data continues to occupy the user's device storage. When you call completeFlexibleUpdate in the foreground, the platform displays a full-screen UI that restarts the app in the background. After the platform installs the update, your app restarts into its main. If you instead call completeFlexibleUpdate when your app is in the background, the update is installed silently without obscuring the device UI.
getUpdateAvailability() Future<PlayxVersionUpdateResult<PlayxAppUpdateAvailability>>
Check for update availability: checks if there is an update available for your app or not. returns PlayxVersionUpdateResult with PlayxAppUpdateAvailability on success.
getUpdatePriority() Future<PlayxVersionUpdateResult<int>>
returns PlayxVersionUpdateResult with int priority value on success.
getUpdateStalenessDays() Future<PlayxVersionUpdateResult<int>>
Check the number of days since the update became available on the Play Store If an update is available or in progress, this method returns the number of days since the Google Play Store app on the user's device has learnt about an available update. If update is not available, or if staleness information is unavailable, this method returns -1. returns PlayxVersionUpdateResult with int number of days on success.
isFlexibleUpdateNeedToBeInstalled() Future<PlayxVersionUpdateResult<bool>>
Whether or not there is any flexible update that need to be installed. should be used before calling completeFlexibleUpdate unless you know that the update is downloaded. returns PlayxVersionUpdateResult with bool on success that if true the flexible download is downloaded and ready to be installed.
isUpdateAllowed({required PlayxAppUpdateType type}) Future<PlayxVersionUpdateResult<bool>>
returns PlayxVersionUpdateResult with bool isAllowed value on success.
listenToFlexibleDownloadUpdate() Stream<PlayxDownloadInfo?>
Monitor the state of an update in progress by registering a listener for install status updates. You can also provide a progress bar in the app's UI to inform users of the download's progress. returns stream of PlayxDownloadInfo current download progress value on success.
openStore({required String storeUrl, LaunchMode launchMode = LaunchMode.externalApplication}) Future<PlayxVersionUpdateResult<bool>>
Open the Google play store in Android Or App Store in IOS Takes String storeUrl : which is the URL to the Specified store. LaunchMode :Which decide the desired mode to launch the store. Support for these modes varies by platform. Platforms that do not support the requested mode may substitute another mode. See launchUrl for more details. returns PlayxVersionUpdateResult with bool on success. and returns PlayxVersionUpdateError on error which contains information about the error.
refreshInAppUpdate() Future<PlayxVersionUpdateResult<bool>>
Refreshes app update manger. returns PlayxVersionUpdateResult with bool on success of whether refreshed or not.
showInAppUpdateDialog({required BuildContext context, required PlayxAppUpdateType type, bool? forceUpdate, String? localVersion, String? newVersion, String? minVersion, String? googlePlayId, String? appStoreId, String country = 'us', String language = 'en', bool showPageOnForceUpdate = false, bool? isDismissible = true, UpdateNameInfoCallback? title, UpdateNameInfoCallback? description, UpdateNameInfoCallback? releaseNotesTitle, bool showReleaseNotes = false, bool showDismissButtonOnForceUpdate = true, String? updateActionTitle, String? dismissActionTitle, UpdatePressedCallback? onIosUpdate, UpdateCancelPressedCallback? onIosCancel, LaunchMode launchMode = LaunchMode.externalApplication, Widget? leading}) Future<PlayxVersionUpdateResult<bool>>
In Android: If there is an update available and the update type is allowed. It starts either flexible update or immediate update specified by PlayxAppUpdateType. If you started a flexible update you can listen to update progress from listenToFlexibleDownloadUpdate When you detect the PlayxDownloadStatus.downloaded state, you need to restart the app to install the update. Unlike with immediate updates, Google Play does not automatically trigger an app restart for a flexible update. So you need to complete the update after it's downloaded. it's also recommended to check whether your app has an update waiting to be installed on App resume. If your app has an update in the DOWNLOADED state, prompt the user to install the update. Otherwise, the update data continues to occupy the user's device storage. To check if flexible update needs to be completed call isFlexibleUpdateNeedToBeInstalled and to complete the update call completeFlexibleUpdate Check out startFlexibleUpdate and startImmediateUpdate to learn more about the result of each call. In IOS: Check the version of the app on the App Store. Then shows PlayxUpdateDialog which shows Cupertino Dialog for IOS. If the app needs to force update you can show PlayxUpdatePage instead of the dialog by setting showPageOnForceUpdate : to true. Update isDismissible to set if the PlayxUpdateDialog or PlayxUpdatePage are dismissible or not if not provided it will be not dismissible on force update. check out checkVersion and PlayxUpdateDialog and PlayxUpdatePage to learn more about the parameters used. When the user clicks on update action the app open the app store, If you want to override this behavior you can call onIosUpdate. returns PlayxVersionUpdateResult with bool on success. and returns PlayxVersionUpdateError on error which contains information about the error.
showUpdateDialog({required BuildContext context, String? localVersion, String? newVersion, String? minVersion, String? googlePlayId, String? appStoreId, String country = 'us', String language = 'en', bool? forceUpdate, bool showPageOnForceUpdate = false, bool? isDismissible, UpdateNameInfoCallback? title, UpdateNameInfoCallback? description, UpdateNameInfoCallback? releaseNotesTitle, bool showReleaseNotes = false, bool showDismissButtonOnForceUpdate = true, String? updateActionTitle, String? dismissActionTitle, UpdatePressedCallback? onUpdate, UpdateCancelPressedCallback? onCancel, LaunchMode launchMode = LaunchMode.externalApplication, Widget? leading}) Future<PlayxVersionUpdateResult<bool>>
Check the version of the app on Google play store in Android Or App Store in IOS. Then shows PlayxUpdateDialog which shows material update dialog for android and Cupertino Dialog for IOS. If the app needs to force update you can show PlayxUpdatePage instead of the dialog by setting showPageOnForceUpdate : to true. Update isDismissible to set if the PlayxUpdateDialog or PlayxUpdatePage are dismissible or not if not provided it will be not dismissible on force update. check out checkVersion and PlayxUpdateDialog and PlayxUpdatePage to learn more about the parameters used. When the user clicks on update action the app open the store, If you want to override this behavior you can call onUpdate. returns PlayxVersionUpdateResult with bool on success. and returns PlayxVersionUpdateError on error which contains information about the error.
startFlexibleUpdate() Future<PlayxVersionUpdateResult<bool>>
Starts Flexible update flow. In the flexible flow, the method returns one of the following values: bool : The user accepted the request to update. ActivityNotFoundError : : When the user started the update flow from background. PlayxInAppUpdateCanceledError : The user denied the request to update. PlayxInAppUpdateInfoRequestCanceledError : Checking update availability was canceled. PlayxInAppUpdateFailedError :: Something failed during the request for user confirmation. For example, the user terminates the app before responding to the request. DefaultFailureError : other errors that may occur during the update flow.
startImmediateUpdate() Future<PlayxVersionUpdateResult<bool>>
Starts immediate update flow. In the immediate flow, the method returns one of the following values of the PlayxVersionUpdateResult: bool : The user accepted and the update succeeded. (which, in practice, your app never should never receive because it already updated). ActivityNotFoundError : When the user started the update flow from background. PlayxInAppUpdateCanceledError : The user denied or canceled the update. PlayxInAppUpdateInfoRequestCanceledError : Checking update availability was canceled. PlayxInAppUpdateFailedError : The flow failed either during the user confirmation, the download, or the installation. DefaultFailureError : other errors that may occur during the update flow.