Skip to content

v0.7.0-alpha - App Open ads (Android device-verified)

Pre-release
Pre-release

Choose a tag to compare

@blessedzulu blessedzulu released this 01 Jun 12:48
· 18 commits to main since this release

Fifth and final ad format. App Open ads render full-screen on Android (verified end-to-end via Zamcalc: load → background → foreground → auto-show → dismiss → auto-reload). iOS code ships untested.

Highlights

  • Admob::appOpen('slot')->load() pre-loads the ad. The native lifecycle observer presents the cached ad on every subsequent app foreground.
  • Auto-show via AppOpenLifecycle. Android subscribes to NativePHPLifecycle.on(\"onResume\"). iOS subscribes to UIApplication.didBecomeActiveNotification. Both shown the cached ad if fresh; both silently discard stale ads (>4h).
  • 4-hour staleness check. Per Google's recommendation. Stale ads are discarded; the consumer drives the re-load via #[OnNative(AdDismissed::class)] or periodic load.
  • Manual override also shipped: Admob::appOpen('slot')->isReady() + ->show() for consumers with non-standard lifecycle needs.

Fixes during phase

  • coldStartConsumed defaults to true on both platforms. init_function runs AFTER the first MainActivity.onResume, so by the time the lifecycle observer subscribes, the cold-start resume has already fired. Default to consumed; the first observed foreground (background → foreground transition) triggers auto-show as expected.
  • TestAdUnits::APP_OPEN corrected. The original ID (/3419835294) didn't match the AppOpen format - Google rejects it with errorCode 3. Replaced with the correct Android portrait test ID (/9257395921). iOS uses a different test ID (/5662855259); TestAdUnits is currently Android-biased - platform-aware test IDs queued for Phase 9 polish.

Known limitations

  • Stale ads silently discarded; the plugin does NOT auto-load a replacement. Consumers should wire #[OnNative(AdDismissed::class)] to call load() again. Built-in auto-refresh planned for Phase 9.

Still stubs

UMP consent (Phase 7), ATT (Phase 8). After Phase 8, all five formats + consent surface ship real.

Full notes: CHANGELOG.md.