Skip to content

v0.7.1-alpha - Fix: AppOpen auto-show after fullscreen dismiss

Pre-release
Pre-release

Choose a tag to compare

@blessedzulu blessedzulu released this 01 Jun 13:30
· 17 commits to main since this release

Bug fix on top of v0.7.0-alpha. Caught immediately after Phase 6 ship.

Symptom

Dismissing any full-screen ad (interstitial, rewarded, rewarded interstitial) caused the cached App Open ad to auto-show immediately after - producing a back-to-back ad UX that no app should ever ship.

Root cause

MainActivity.onResume (Android) and UIApplication.didBecomeActiveNotification (iOS) BOTH fire when the SDK's full-screen activity / view controller tears down at dismiss time. From the lifecycle observer's perspective this looks identical to a real background→foreground transition, so it auto-showed the cached App Open ad.

Fix

New FullScreenAdState singleton on both platforms:

  • Each FullScreenContentCallback (Android) / FullScreenContentDelegate (iOS) calls FullScreenAdState.markDismissed() on dismiss + on failed-show. Covers all four full-screen formats: interstitial, rewarded, rewarded interstitial, app open.
  • AppOpenLifecycle.onResume / didBecomeActive observer checks FullScreenAdState.recentlyDismissed() (true if within 1500ms) and suppresses auto-show.

The 1500ms grace window is generous - the resume event follows dismiss by tens to a few hundred ms in practice; this absorbs slower devices and emulator scheduling jitter.

Verified

Android emulator end-to-end: rewarded ad shown → dismissed → logcat shows:

AppOpenLifecycle: onResume callback fired (..., recentlyDismissed=true)
AppOpenLifecycle: suppressing auto-show: another full-screen ad dismissed within 1500ms

App Open is NOT auto-shown. User returns to the host app screen.