# Changelog All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [0.3.0] - 2026-10-10 Banners, native ads, impression-level revenue, segments, dynamic user id, placement capping and Capacitor 7 support. Fully backwards compatible with 0.2.x. ### Added (API) - `docs/design-0.3.md`: banner, native ad, impression data, placement, segment and dynamic user id design with the exact LevelPlay 9.6.1 Android / iOS mappings, overlay positioning, error codes, Capacitor 7 findings, test plan. - TypeScript API (`@since 0.3.0`): `getCapabilities`, `setSegment`, `setDynamicUserId`, `isPlacementCapped`, `getReward`, `createBanner` / `loadBanner` / `showBanner` / `hideBanner` / `setBannerLayout` / `destroyBanner`, `loadNativeAd` / `showNativeAd` / `setNativeAdRect` / `hideNativeAd` / `destroyNativeAd`; events `adInfoChanged`, `impressionData`, `banner*` and `nativeAd*`. - `AdInfo` gains optional `ab`, `segmentName`, `encryptedCPM`, `creativeId`, `conversionValue` (iOS) and `adSize`. - Web stubs for every new method. ### Added (Android) - Banners in a pass-through overlay above the WebView: presets, `ADAPTIVE` (width in dp = CSS px, recreated on rotation), `CUSTOM` sizes, top / bottom / center with offsets, safe area from the WebView's on-screen rect and the window insets, several banners by id, every `banner*` event. - Native ads with the plugin's `small` and `medium` templates (colours, corner radius, fonts) and `nativeAd*` events. - `impressionData` from per-ad listeners, queued (max 100) until the first JS listener; `adInfoChanged`; `getCapabilities`, `setSegment`, `setDynamicUserId`, `isPlacementCapped`, `getReward`. - `AdInfo` fields `ab`, `segmentName`, `encryptedCPM`, `creativeId`, `adSize` on Android. - JVM unit tests for the overlay geometry and argument validation (`bun run verify:android`). - `BannerSize` `CUSTOM` with `customSize`, `NativeAdTemplateStyle` fonts, banner ids in `LEVELPLAY_DEMO`. ### Added (iOS) - Banners in a pass-through overlay inside the WebView: presets, `ADAPTIVE` (width in pt = CSS px, recreated when the safe-area width changes), `CUSTOM` sizes, top / bottom / center with offsets, safe area, several banners by id, every `banner*` event. - Native ads with the plugin's `small` and `medium` templates built in code (`ISNativeAdView` binding; colours, corner radius, system or web-asset fonts) and `nativeAd*` events. - `impressionData` from per-ad delegates (with `conversionValue`), queued (max 100) until the first JS listener; native impressions synthesised; `adInfoChanged`; `getCapabilities`, `setSegment`, `setDynamicUserId`, `isPlacementCapped`, `getReward`; cleanup of banners and native ads when the plugin is released. - `AdInfo` fields `ab`, `segmentName`, `encryptedCPM`, `creativeId`, `conversionValue`, `adSize` on iOS. ### Added (tooling and docs) - `bun run test`: `bun test` for the web stub (unimplemented rejections vs no-ops), `LEVELPLAY_DEMO` and the exports, plus a compile-only check of the public API (`tsc -p test`); `verify` runs it. - `example-app/`: a minimal Capacitor 8 app (HTML + TypeScript, esbuild) with the demo ids and buttons for every format, segments and an impression log; Android and iOS (SPM) platforms committed. Not part of the npm package. - README: banners, native ads (style options), impression data, segments / user id / placements, error codes, limitations, example app, Capacitor 7. ### Changed - Capacitor 7 support: `peerDependencies` `@capacitor/core >=7.0.0`; `Package.swift` depends on `capacitor-swift-pm` `"7.0.0"..<"9.0.0"`; iOS deployment target 14.0 in `Package.swift` and the podspec (was 15.0); Android `minSdkVersion` fallback 23 (was 24). Checked by building a Capacitor 7.6.9 app for Android and the iOS simulator. ## [0.2.1] - 2026-10-10 ### Changed - Author and copyright: CRTkafa (LICENSE, `package.json`, README, podspec). - `repository.url` is the plain repo address (npmjs.com shows it readable instead of `git+https://….git`). - Android Java package and Gradle namespace renamed to `fyi.crt.capacitor.levelplay`. Run `npx cap sync` after updating; no API or behaviour changes. ## [0.2.0] - 2026-10-10 First public release on npm. No behaviour changes to the native bridges since 0.1.0. ### Added - Complete README: compatibility table, iOS (SPM and CocoaPods) and Android setup, usage guide, mediation adapters (Gradle, Swift packages, local-package workaround for networks without an official Swift package), privacy and ATT guide, troubleshooting, FAQ. - API reference generated from the JSDoc in `src/definitions.ts` with `@capacitor/docgen` (`bun run docgen`, also part of `bun run build`); `dist/docs.json` ships with the package. - JSDoc with `@since` for every method, option, event and type. - `verify:android` script and a standalone Gradle setup (`android/settings.gradle`, Gradle wrapper 8.14.3) that builds the Android library against `@capacitor/android` (dev dependency). - `CONTRIBUTING.md`. ### Changed - `package.json`: description, author, `homepage`, `bugs`, `repository`, keywords, `engines` (Node 22+, as Capacitor 8), `files` (adds `CHANGELOG.md`). - Podspec: homepage from `package.json`, source is `https://git.crt.fyi/CRT/capacitor-levelplay.git` at tag `v`. - `tsconfig.json`: no explicit `lib` (same defaults for `target: es2017`), so docgen resolves `Promise` types. ## [0.1.0] - 2026-10-09 ### Added - Capacitor 8 plugin for Unity LevelPlay rewarded and interstitial ads (ad-unit API). - iOS: Swift Package Manager with the official LevelPlay-Swift-Package (SDK 9.6.1); podspec on `IronSourceSDK ~> 9.6.1`. - Android: `com.unity3d.ads-mediation:mediation-sdk:9.6.1` from Maven Central, Play services ids, consumer ProGuard rules. - API: `initialize`, `setConsent` (GDPR / CCPA / COPPA), `setMetaData`, iOS ATT, load / show / isReady per ad unit, `launchTestSuite`, `validateIntegration`, events `loaded` `loadFailed` `displayed` `displayFailed` `clicked` `closed` `rewarded`. Show calls resolve after close with `{ shown, rewarded, reward?, error? }`. - `LEVELPLAY_DEMO`: Unity's public demo app keys and ad unit ids. [Unreleased]: https://git.crt.fyi/CRT/capacitor-levelplay/compare/v0.3.0...main [0.3.0]: https://git.crt.fyi/CRT/capacitor-levelplay/compare/v0.2.1...v0.3.0 [0.2.1]: https://git.crt.fyi/CRT/capacitor-levelplay/compare/v0.2.0...v0.2.1 [0.2.0]: https://git.crt.fyi/CRT/capacitor-levelplay/compare/v0.1.0...v0.2.0 [0.1.0]: https://git.crt.fyi/CRT/capacitor-levelplay/releases/tag/v0.1.0