v1.0.0#17
Merged
Merged
Conversation
- Updated SDK constraints to `'>=3.6.0 <4.0.0'` and Flutter to `'>=3.27.0'` - Upgraded `playx_network` to `^0.5.0`
… 86c49fq26 This commit refactors the public API by introducing two new option classes: - `PlayxUpdateOptions`: Consolidates parameters related to version checking (e.g., store IDs, local/new versions, country, language). - `PlayxUpdateUIOptions`: Consolidates parameters related to the visual presentation of update dialogs/pages (e.g., titles, descriptions, button labels, callbacks, show/hide elements). This change aims to: - Simplify method signatures for `checkVersion`, `showUpdateDialog`, and `showInAppUpdateDialog`. - Improve code organization and readability by grouping related configurations. - Enhance extensibility for future options. The core functionality remains the same, but the way options are passed to the library's methods has been updated. Internal logic for displaying UI elements has also been refactored to use these new option classes.
This commit introduces a new `PlayxUpdateDisplayType` enum to control the presentation of Flutter-based update prompts (dialog, page, or page on force update). It also adds extensive UI customization options for Flutter-based update dialogs and pages: - `titleTextStyle`, `descriptionTextStyle`, `releaseNotesTitleTextStyle`, `releaseNotesTextStyle`, `updateButtonTextStyle`, `dismissButtonTextStyle` for text styling. - `updateButtonStyle`, `dismissButtonStyle` for button styling. The default behavior for `PlayxUpdateUIOptions.displayType` is now `pageOnForceUpdate`. The `showPageOnForceUpdate` option in `PlayxUpdateUIOptions` has been removed in favor of the new `displayType` enum. `UpdateNameInfoCallback` has been renamed to `UpdateTextInfoCallback` for clarity. `PlayxUpdatePage` and `PlayxUpdateDialog` have been updated to utilize the new text and button style options and to align dismissibility logic with the `isDismissible` property and `forceUpdate` status.
- Upgraded Android Gradle Plugin to version 8.7.3. - Upgraded Kotlin to version 2.1.0. - Updated compile SDK to 36. - Set Java and Kotlin JVM target to 17. - Updated Gradle wrapper to version 8.12. - Removed plugin management and plugins block from `settings.gradle` as they are now handled by the top-level `build.gradle` file.
…r explanations
This commit significantly improves the example app by:
- **Enhancing UI:** Updated button labels for clarity and added more visual elements to demonstrate UI customization options.
- **Detailed `showUpdateDialog`:** Showcases extensive UI customization using `PlayxUpdateUIOptions`, including custom leading widget, text styles, button styles, and action callbacks.
- **Improved In-App Update Demonstrations:**
- Clarified behavior for both Android (native) and iOS (custom UI) for flexible and immediate updates.
- Provided detailed examples of using `iosUiOptions` for customizing the fallback UI on iOS.
- **Refined `checkVersion`:**
- Demonstrates using `PlayxUpdateOptions` for `checkVersion`.
- Shows how to conditionally display `PlayxUpdatePage` for forced updates and `PlayxUpdateDialog` for optional updates, both with custom UI configurations.
- **Better User Feedback:** Implemented a `_showMessage` helper to display success and error messages via SnackBars.
- **Code Clarity:**
- Added more comprehensive comments explaining the purpose of different methods and parameters.
- Improved formatting and variable naming for better readability.
- Added `debugShowCheckedModeBanner: false` for a cleaner example UI.
- **Robust Error Handling:** Ensured error messages from async operations are displayed to the user.
- **Flexible Update Flow:** Added logging for flexible update download failures.
This commit migrates the Android example project to use Gradle Kotlin DSL (`.gradle.kts`) instead of Groovy (`.gradle`). Key changes include: - Renamed `build.gradle` and `settings.gradle` files to `build.gradle.kts` and `settings.gradle.kts` respectively. - Updated Gradle wrapper to version 8.12. - Updated Android Gradle Plugin to 8.7.3 and Kotlin Android plugin to 2.1.0 in `settings.gradle.kts`. - Updated `compileOptions` and `kotlinOptions` to Java 17. - Adjusted package name for `MainActivity.kt` and `AndroidManifest.xml` from `io.sourcya.playx_version_update_example` to `com.example.playx_version_update_example`. - Removed `INTERNET` permission from `AndroidManifest.xml` as it's typically added by Flutter itself if needed. - Increased Gradle JVM arguments in `gradle.properties`. - Added `.cxx/` to `.gitignore`. - Deleted old Groovy-based `build.gradle`, `settings.gradle` and `MainActivity.kt` files.
This commit introduces a new `Version` class for more robust and flexible parsing and comparison of version strings. The new class supports: - Standard SemVer (e.g., "1.2.3-alpha.1+build.456") - Multi-part numeric versions (e.g., "2.25.18.80") - Flexible parsing with defaults for missing components - Ignoring non-numeric tags in the core version string The Google Play Store version parsing logic has been updated to use this new `Version` class and to improve the reliability of extracting the store version by trying multiple regex patterns. The `version` package dependency has been removed as its functionality is now covered by the new internal `Version` class.
This commit introduces several improvements to the in-app update functionality:
- **Enhanced Android Error Handling:**
- Replaced the generic `PlayxInAppUpdateFailed` with a more detailed `PlayxInstallError` sealed class. This class maps directly to Android's `InstallErrorCode` and provides specific error types like `ApiNotAvailable`, `AppNotOwned`, `DownloadNotPresent`, etc.
- Improved how exceptions are caught and processed in `UpdateManger.kt` to convert `InstallException` into the new `PlayxInstallError` types.
- Removed the reliance on `onActivityResult` for update flow results, using the `Task`'s success/failure/cancel listeners directly for more robust error reporting.
- **Improved Dart Error Classes:**
- Updated `PlayxVersionUpdateError.dart` to include the new `PlayxInstallError` hierarchy, mirroring the Kotlin changes.
- Renamed `PLAYX_REQUEST_CANCELLED` to `PLAYX_INFO_REQUEST_CANCELLED` for better clarity.
- Refined error messages across various `PlayxVersionUpdateError` subclasses to be more user-friendly and informative.
This commit refactors the error handling in `playx_version_update` to provide more specific and actionable error information. **Key changes:** * **Introduced `PlayxVersionNetworkError`:** This new error class wraps `playx_network`'s `NetworkException` to differentiate network-related issues (like timeouts or no internet) from other update errors. This allows for more targeted error handling and user feedback. * **Removed generic network error factory:** The `PlayxVersionUpdateError.fromNetworkException` factory was removed as network errors are now handled by `PlayxVersionNetworkError`. * **Exported `playx_network` exceptions:** Common `playx_network` exceptions are now exported from `playx_version_update.dart` for easier access by developers. * Minor code formatting and documentation improvements.
Introduces `NetworkExceptionsMessages` class to provide specific error messages for network-related exceptions encountered during app version checks. This allows for more user-friendly and context-aware error handling. The `NetworkClient` is updated to utilize these custom messages.
- For showInAppUpdateDialog if If a flexible update is already downloaded, prompt to complete it
- Merged `PlayxInAppUpdateInfoRequestCanceledError` into `PlayxInAppUpdateCanceledError` to simplify error handling.
- Improved documentation for in-app update methods in `PlayxVersionUpdate` with:
- Clearer descriptions of immediate and flexible update flows.
- Detailed explanations of possible error types for each method.
- Best practice recommendations for using flexible updates and handling app resume scenarios.
- Added `updateData` and `updateError` getters to `PlayxVersionUpdateResult` for easier access to success data or error information.
…ements, and build system updates
…xVersionUpdateInfo documentation
…e features, installation, and usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.0.0 - [2025-07-06]
This major release introduces significant refactoring, enhanced error handling, improved customization options, and updated build infrastructure.
✨ Major Features & API Enhancements
PlayxUpdateOptionsto consolidate parameters for version checking (e.g., store IDs, local/new versions, country, language).PlayxUpdateUIOptionsto consolidate parameters for the visual presentation of update dialogs/pages (e.g., titles, descriptions, button labels, callbacks, show/hide elements).checkVersion,showUpdateDialog, andshowInAppUpdateDialog, improving organization and extensibility.PlayxInAppUpdateFailedwith a detailedPlayxInstallErrorsealed class, directly mapping to Android'sInstallErrorCodefor specific error types (e.g.,ApiNotAvailable,AppNotOwned,DownloadNotPresent).PlayxVersionNetworkErrorto wrapplayx_network'sNetworkException, differentiating network issues from other update errors, while providing specific, user-friendly messages for network-related exceptions during app version checksPlayxInAppUpdateInfoRequestCanceledErrorintoPlayxInAppUpdateCanceledErrorfor simplified error handling.Versionclass for robust and flexible parsing/comparison of version strings (supporting SemVer, multi-part numeric versions, and ignoring non-numeric tags) like 2.25.18.80.Versionclass.versionpackage dependency.PlayxUpdateDisplayTypeenum to control Flutter-based update prompt presentation (Dialog, Page, or Page on Force Update).titleTextStyle,descriptionTextStyle,releaseNotesTitleTextStyle,releaseNotesTextStyle, button text styles) and button styles.PlayxUpdateUIOptions.displayTypenow defaults topageOnForceUpdate.UpdateNameInfoCallbackrenamed toUpdateTextInfoCallback.✨ Enhancements & Refinements
showInAppUpdateDialognow prompts to complete it.PlayxVersionUpdate, providing clearer descriptions of immediate and flexible flows, detailed error types, and best practice recommendations.updateDataandupdateErrorgetters toPlayxVersionUpdateResultfor easier access to success data or error information.⚙️ Build System & Example App Updates
8.7.3and Kotlin to2.1.0.36.17.8.12..gradle.kts).PlayxUpdateUIOptions(custom leading widget, text styles, button styles, action callbacks).iosUiOptionsexamples.PlayxUpdateOptionsforcheckVersionand conditional display ofPlayxUpdatePage(forced) andPlayxUpdateDialog(optional) with custom UI.⬆️ Dependency Updates
>=3.6.0 <4.0.0and Flutter to>=3.27.0.playx_networkto^0.5.1.