Skip to content

v8.2.1

Latest

Choose a tag to compare

@rdlabo rdlabo released this 06 Oct 22:24

v8.2.1 introduces Native Ads (Preview) for iOS and Android, fixes web audio remaining silent after full-screen ads on iOS, and updates the iOS Google Mobile Ads SDK.

New: Native Ads (Preview)

Display native ads inline with your app's content using NativeAdFeed and the <capacitor-admob-native> element. The plugin renders Google Mobile Ads SDK views and handles ad assets, clicks, impressions, and revenue events. No app-side Kotlin or Swift implementation is needed. (#454)

  • Framework-independent API with usage examples for Angular, React, and Vue.
  • Small and Medium templates, configurable styling, and stable keys for each ad slot.
  • Scroll following and rectangular clipping for ordinary HTML scroll containers and Ionic ion-content. On iOS, pass the container through scrollElement to enable native scroll tracking.
  • Explicit pause(), resume(), invalidateLayout(), and destroy() methods for screen and overlay lifecycle management.
  • Production ad units through adId; Google's test ads through isTesting: true.
  • An Ionic demo screen accessible from the Demo page.

Preview means the API may change in a minor release. Testing and production use are both allowed. Existing ad APIs remain available.

Getting started

After obtaining consent and initializing AdMob, create a feed and place a matching slot in your page:

import { NativeAdFeed, NativeAdTemplate } from '@capacitor-community/admob';

const feed = await NativeAdFeed.create({
  feedId: 'home-feed',
  template: NativeAdTemplate.Medium,
  isTesting: true,
});
<capacitor-admob-native
  feed-id="home-feed"
  slot-key="sponsored-after-article-42"
></capacitor-admob-native>

For production, provide your platform-specific native ad unit ID as adId and omit isTesting or set it to false. Await feed.destroy() when leaving the screen.

Read the Native Ads guide for framework setup, sizing, events, iOS scroll configuration, and complete lifecycle examples.

Current limitations

  • iOS and Android only; browsers/PWAs and virtual scrolling are not supported.
  • Native ads appear above the WebView. Await pause() before showing a web modal or another covering overlay, then call resume() after dismissal. A swipe beginning on an ad may not reach the web scroll container.
  • Fast scrolling can still produce visible lag, particularly on Android.
  • Small has no video area: video creatives fail to load for that template. Use Medium for ad units that serve video.
  • Slot dimensions must accommodate the ad's content. Android Medium ads stay hidden if their measured media area is below 120×120dp; larger text or device font scaling can require a larger slot.

Fix: iOS web audio after full-screen ads

Fixes a problem where Web Audio could remain silent after dismissing an interstitial, rewarded, or rewarded interstitial ad, requiring an app restart. Web media is now suspended while these ads are presented and released after dismissal or a presentation failure. Suspension is tracked per ad so one ad cannot prematurely resume media for another. (#470, related to #471)

No new API calls are required. Apps should expect web media to pause while these full-screen ads are shown.

SDK and maintenance updates

  • iOS Google Mobile Ads SDK: 13.6.0 → 13.11.0, for both Swift Package Manager and CocoaPods. Existing minimum platform and toolchain requirements are unchanged. Android remains on 25.4.x. (#484)
  • iOS XCTest now runs on a simulator in CI. (#485)
  • Documentation now consistently describes the v8.2.0 migration requirements and behavior changes. (#483)

Upgrading

npm install @capacitor-community/admob@8.2.1
npx cap sync

Rebuild your native apps after syncing. For iOS projects using Swift Package Manager, resolve package dependencies so Google Mobile Ads SDK 13.11.0 is selected.

Existing v8.2.0 integrations require no API migration for this release. The existing requirement for Capacitor 8.5 or later within v8 still applies. If upgrading from an older plugin release, review the migration guide, especially initialization error handling, iOS revenue units, and consent ordering.

Contributors

Thank you to @atakahveci-cg for their first contribution, the iOS web audio fix in #470, and to @rdlabo for the Native Ads implementation, SDK update, CI, and documentation work.

Full changelog: v8.2.0...v8.2.1