Skip to content

v0.4.0-alpha - Banner ads (Android device-verified)

Pre-release
Pre-release

Choose a tag to compare

@blessedzulu blessedzulu released this 31 May 19:39
· 39 commits to main since this release

First real ad format ships. Banner ads now render on Android (verified end-to-end on a real device via Zamcalc). iOS mirror written against Google's reference docs but untested on real hardware - please open issues if anything regresses there.

Highlights

  • Admob::banner('slot')->load()->show('bottom') paints a real Google AdMob banner via AdView (Android) / BannerView (iOS), overlaid on the activity's root view / key window.
  • Adaptive banner sizing on both platforms.
  • Lifecycle (pause/resume/destroy) wired to NativePHP's lifecycle events / iOS NotificationCenter.
  • Banner-side events (AdLoaded, AdFailedToLoad, AdImpression, AdClicked, AdShown, AdShowFailed) dispatch to Livewire #[OnNative] listeners.
  • New post_compile hook substitutes ${ADMOB_APP_ID} placeholders in the compiled AndroidManifest.xml / Info.plist (NativePHP's compiler does not do this itself).

Fixed

  • Banner load/show race - registry lookup moved inside the UI-thread block so it lands after LoadBanner's queued AdView creation. Dispatches AdShowFailed if the slot is still empty.
  • All 22 Kotlin bridge function classes now take FragmentActivity in their primary constructor to match NativePHP's compiler-emitted call site.

Compat

  • Android SDK pins: play-services-ads:24.0.0 + user-messaging-platform:3.0.0 (matched to NativePHP Mobile v3.3.5's Kotlin 2.0 toolchain). Newer AdMob SDKs require Kotlin 2.1.

Still stubs

Interstitial, Rewarded, Rewarded Interstitial, App Open, UMP, ATT - tracked in Phases 4 through 8.

Full notes: CHANGELOG.md.