InterstitialAdEffect

fun InterstitialAdEffect(adUnitId: String, showMode: InterstitialShowMode = InterstitialShowMode.TIME, maxDisplayCount: Int = 3, onAdShown: () -> Unit? = null, onAdDismissed: () -> Unit? = null, onAdFailedToLoad: (String) -> Unit? = null)

A Compose effect for managing interstitial ads with automatic display logic.

This version automatically manages when to show interstitial ads based on AdManager's built-in display intervals and user interactions.

Parameters

adUnitId

The AdMob interstitial ad unit ID

showMode

The mode for showing ads (TIME, COUNT, or FORCE)

maxDisplayCount

Maximum display count (only used with COUNT mode)

onAdShown

Callback when the ad is shown

onAdDismissed

Callback when the ad is dismissed

onAdFailedToLoad

Callback when the ad fails to load