-
-
Notifications
You must be signed in to change notification settings - Fork 10
Release: Version 1.1.0 #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
This commit marks the 1.1.0 stable release of the library.
* **Version Bump:**
* The library version is updated from `1.1.0-beta03` to `1.1.0`.
* **Documentation:**
* The `VERSIONS.md` file has been updated to include the `1.1.0` release.
This commit refactors the `ConsentPopup` composable to be more robust by ensuring consent information is up-to-date before the form is shown.
* **`ConsentPopup` Composable (Common):**
* The `ConsentPopup` now automatically calls `requestConsentInfoUpdate` before attempting to display the form.
* The `loadAndShowConsentForm` function is now invoked within the `onCompletion` callback of the update request. This chains the two operations, guaranteeing that the consent status is fresh when the form is loaded.
* Fix: Correct README setup and bump version
This commit corrects the setup instructions in the README and increments the library version.
* **Version Bump:**
* The library version is updated from `1.1.0-beta02` to `1.1.0-beta03`.
* **Documentation Fixes:**
* Corrected the Gradle plugin aliases in `README.md` to use `libs.plugins.jetbrains.compose` and `libs.plugins.jetbrains.compose.compiler`.
* Updated the dependency name in the `README.md` setup guide from `libs.lexilabs.basic.ads` to `libs.basic.ads`.
* Updated the Kotlin version badge to `2.3.0`.
* **Version History:**
* The `VERSIONS.md` file has been updated to log the `1.1.0-beta02` and `1.1.0-beta03` releases.
* Fix: Remediate security vulnerabilities in transitive dependencies (#128)
This commit updates the build configuration to mitigate several security vulnerabilities present in transitive dependencies. It replaces the previous `compileOnly` approach with Gradle's dependency constraints, which provides a more robust method for forcing specific, non-vulnerable versions of these libraries.
* **Dependency Constraints:**
* A `constraints` block has been added to `basic-ads/build.gradle.kts` to enforce strict versions for vulnerable transitive dependencies on the `androidMain` configuration.
* **Vulnerabilities Addressed:**
* **`okhttp`**: Patched for `CVE-2021-0341`.
* **`org.bitbucket.b_c:jose4j`**: Patched for `CVE-2024-29371`.
* **`io.netty`**: Patched for `CVE-2025-67735` and `CVE-2025-55163`.
* **`com.google.protobuf`**: Patched for `CVE-2024-7254`.
* **`org.jdom:jdom2`**: Patched for `CVE-2021-33813`.
* **`org.apache.commons:commons-compress`**: Added and patched for `CVE-2024-26308`.
* **Build Configuration:**
* The `libs.versions.toml` file has been updated to centralize the version numbers for these remediated dependencies.
* Refactor: Introduce DSL for Native Ad templates
This commit introduces a new declarative DSL for constructing native ad layouts, replacing the previous override-based approach. The new `NativeAdTemplate` provides a `Supervisor` scope with composable functions for each ad asset, simplifying custom ad view creation.
This change is marked as experimental and requires opting in with `@ExperimentalBasicAdsFeature`.
* **New `NativeAdTemplate` DSL:**
* A new `NativeAdTemplate` abstract class has been created with `expect` declarations in `commonMain` and platform-specific `actual` implementations.
* It introduces a `Supervisor` composable that provides a `SupervisorScope`.
* Within this scope, developers can use composables like `Headline`, `Body`, `Media`, `Icon`, and `CallToAction` to build the ad layout declaratively.
* This DSL handles the underlying platform view registration (`NativeAdView` on Android, `GADNativeAdView` on iOS) automatically.
* **Refactored `NativeAdDefault`:**
* The `NativeAdDefault` implementation has been refactored to use the new `NativeAdTemplate` DSL, resulting in a much simpler and more readable layout definition.
* Redundant implementation code has been removed from the `androidMain` and `iosMain` variants of `NativeAdDefault` and centralized in the `NativeAdTemplate` base.
* **Experimental API:**
* All new and related native ad composables, including `NativeAd`, `NativeAdDefault`, and `NativeAdTemplate`, are now annotated with `@ExperimentalBasicAdsFeature`.
* **API Update:**
* The public API dump has been updated to reflect the new DSL structure.
* Refactor: Unify NativeAdDefault and rename Image to AdIcon
This commit refactors the native ad implementation by moving the `NativeAdDefault` composable to `commonMain` and renaming several related classes for clarity.
* **`NativeAdDefault` Unification:**
* The `expect` class `NativeAdDefault` and its `actual` implementations on Android and iOS have been removed.
* A single, unified `NativeAdDefault` class now resides in `commonMain`, providing a consistent default layout across platforms and reducing code duplication.
* **API Renaming for Clarity:**
* The data class `NativeAdData.Image` has been renamed to `NativeAdData.AdIcon` to more accurately reflect its purpose.
* The composable function `NativeAdTemplate.Icon` has been renamed to `NativeAdTemplate.AdIcon`.
* In `NativeAdData.AdChoicesInfo`, the `images` property has been renamed to `adIcons`.
* **Implementation Updates:**
* The `AdIcon` composable now directly accepts an `AdIcon` data object instead of a generic content lambda, simplifying its usage within custom templates.
* Platform-specific converters and `NativeAdData` implementations have been updated to align with these renames.
* The public API dump has been updated to reflect all changes.
* Refactor: Improve NativeAd stability and implementation
This commit introduces several refactorings to the `NativeAd` implementation, focusing on improving stability, fixing race conditions on iOS, and refining the API.
* **Robust Native Ad Loading (iOS):**
* The `NativeAdHandler` on iOS now automatically initiates the ad loading process in a background coroutine upon creation. This resolves a race condition where the ad might not have been loaded before being displayed.
* Error logging for ad loading failures has been improved.
* **Null-Safety and State Handling:**
* Removed redundant `nativeAdData != null` checks from individual `NativeAdTemplate` components.
* A central null check is now performed within the `NativeAdDefault.Show()` composable, ensuring `nativeAdData` is available before rendering the ad layout.
* On iOS, the `MediaView` now safely accesses `nativeAdData` to prevent potential null pointer exceptions.
* **API Refinement:**
* The `NativeAdTemplate.copy()` function has been made `abstract`, requiring concrete template implementations like `NativeAdDefault` to provide their own copy logic.
* The public API dump has been updated to reflect these changes.
* Refactor(iOS): Remove unused AdLoader delegate
This commit removes the `AdLoader` class from the `iosMain` source set.
The `AdLoader` class was a `GADAdLoaderDelegateProtocol` implementation used to handle native ad loading callbacks. This file is no longer required as the delegate logic has been consolidated elsewhere.
* Refactor: Improve variable naming in iOS NativeAd
This commit refactors the iOS implementation of the `NativeAd` composable to improve code clarity and readability.
* **Variable Renaming:**
* In `basic-ads/src/iosMain/kotlin/app/lexilabs/basic/ads/composable/NativeAd.kt`, the variable `composeController` has been renamed to `adTemplateController`.
* Similarly, `composeView` has been renamed to `adTemplate`.
* These changes make the code's intent clearer without altering its functionality.
* **Code Cleanup:**
* Removed an extraneous newline from `basic-ads/src/commonMain/kotlin/app/lexilabs/basic/ads/nativead/NativeAdDefault.kt`.
* Refactor: Simplify iOS NativeAdTemplate implementation
This commit refactors the iOS implementation of `NativeAdTemplate` to simplify its structure and remove unnecessary complexity. The custom `ComposeInUIView` and `ViewInUIView` helper composables have been removed in favor of directly using `UIKitView`.
* **View Implementation:**
* All composable elements within the template (`Headline`, `Body`, `CallToAction`, `Icon`, `Media`, etc.) now directly use `UIKitView` to create and manage their underlying native `UIView` components (e.g., `UILabel`, `UIImageView`, `GADMediaView`).
* This change eliminates the need for intermediate `ComposeUIViewController` instances and their associated lifecycle management, resulting in a cleaner and more direct implementation.
* **Data Handling:**
* The `update` blocks for each `UIKitView` now directly populate the native views with data from `nativeAdData` (e.g., setting `text` on a `UILabel` or `image` on a `UIImageView`).
* Views are now automatically hidden if their corresponding data is null or empty.
* **CallToAction Behavior:**
* The `CallToAction` button now correctly has `setUserInteractionEnabled` set to `false`, as the parent `GADNativeAdView` is responsible for handling click events.
* Feat: Promote Native Ads to stable API
This commit stabilizes the Native Ad API by removing the `@ExperimentalBasicAdsFeature` annotation from all related components. Additionally, it includes a refactoring of the iOS implementation to improve view management.
* **API Stabilization:**
* The `@ExperimentalBasicAdsFeature` annotation has been removed from all Native Ad composables and classes, including `NativeAd`, `NativeAdDefault`, and `NativeAdTemplate`.
* The `ExperimentalBasicAdsFeature` annotation class itself has been deleted, marking the Native Ad feature as stable.
* **iOS Implementation Refactor:**
* The responsibility for creating and managing the `GADNativeAdView` on iOS has been moved from the `NativeAd` composable into the `NativeAdTemplate` implementation.
* This change simplifies the `NativeAd` composable and centralizes the native view handling logic within the template.
* Restore signing of publication (accidentally deactivated).
* Refactor: Simplify NativeAdTemplate API
This commit refactors the `NativeAdTemplate` composable API to be more declarative and less boilerplate-heavy. The individual ad asset composables no longer require a `content` lambda, as they now implicitly handle the rendering of the ad data.
* **API Simplification:**
* The `content: @composable () -> Unit` parameter has been removed from `Headline`, `Body`, `CallToAction`, `Advertiser`, `Price`, and `Store`. These composables now automatically render the corresponding data from the `NativeAdData` object.
* The `AdIcon` composable has been renamed to `Icon` and no longer requires an `adIcon` parameter. It now retrieves the icon directly from the provided `NativeAdData`.
* **Improved `StarRating`:**
* The `StarRating` composable has been enhanced. Instead of an empty `content` lambda, it now provides a `stars: @composable (Double) -> Unit` lambda. This allows developers to easily create a custom visual representation for the star rating value.
* **Implementation Cleanup:**
* The `actual` implementations on Android and iOS have been updated to reflect these changes, removing the now-unnecessary `ComposeView` and `UILabel` wrappers and directly accessing the ad data.
* **API Dump:**
* The `basic-ads.api` file has been updated to reflect the new, simpler function signatures.
* Fix(iOS): Ensure native ad views fill their container
This commit corrects the layout behavior of native ads on iOS to ensure they expand to fill the available space of their parent composable.
* **`NativeAd` Composable:**
* The `UIKitView` responsible for displaying the native ad is now modified with `Modifier.fillMaxSize()`. This ensures the ad view stretches to the full dimensions of its container.
* **`NativeAdTemplate`:**
* Similarly, the `UIKitView` within the `NativeAdTemplate` has been updated to use `Modifier.fillMaxSize()`, providing consistent sizing behavior for templated ads.
This commit enhances the KDoc documentation across several public API classes and handlers to improve clarity and developer experience.
* **Ad Handlers:**
* Added `@property` documentation for the `state` property in `InterstitialAdHandler`, `RewardedAdHandler`, and `RewardedInterstitialAdHandler`.
* Added `@property` documentation for `state` and `adSize` in `BannerAdHandler`.
* **`RewardItem`:**
* Added a class-level KDoc summary and `@property` documentation for `amount` and `type`.
* **`RequestConfiguration`:**
* Added descriptive comments for all constants related to child-directed treatment, age of consent, and maximum ad content rating.
* **`ConsentDebugSettings`:**
* Updated the KDoc for the `DebugGeography` enum to use `@property` tags for better readability in generated documentation.
Updated Xcode version to 26.2 to meet requirements.
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.
This commit marks the 1.1.0 stable release of the library.
Version Bump:
1.1.0-beta03to1.1.0.Documentation:
VERSIONS.mdfile has been updated to include the1.1.0release.