rememberInterstitialAd

actual fun rememberInterstitialAd(adUnitId: String, onLoad: () -> Unit, onFailure: (Exception) -> Unit, customTargeting: CustomTargeting?): MutableState<InterstitialAdHandler>

Composable function to remember an interstitial ad.

This function creates and manages an InterstitialAdHandler instance, automatically loading an ad when the state is AdState.DISMISSED or AdState.NONE.

Return

A MutableState holding the InterstitialAdHandler. You can use this to control and observe the ad's state (e.g., to show the ad).

Parameters

adUnitId

The ad unit ID for the interstitial ad. Defaults to AdUnitId.INTERSTITIAL_DEFAULT.

onLoad

A callback function invoked when the ad is successfully loaded.

onFailure

A callback function invoked when ad loading fails, providing the Exception that occurred.

customTargeting

Optional CustomTargeting parameters for ad targeting.

expect fun rememberInterstitialAd(adUnitId: String = AdUnitId.INTERSTITIAL_DEFAULT, onLoad: () -> Unit = {}, onFailure: (Exception) -> Unit = {}, customTargeting: CustomTargeting? = null): MutableState<InterstitialAdHandler>

Composable function to remember an interstitial ad.

This function creates and manages an InterstitialAdHandler instance, automatically loading an ad when the state is AdState.DISMISSED or AdState.NONE.

Return

A MutableState holding the InterstitialAdHandler. You can use this to control and observe the ad's state (e.g., to show the ad).

Parameters

adUnitId

The ad unit ID for the interstitial ad. Defaults to AdUnitId.INTERSTITIAL_DEFAULT.

onLoad

A callback function invoked when the ad is successfully loaded.

onFailure

A callback function invoked when ad loading fails, providing the Exception that occurred.

customTargeting

Optional CustomTargeting parameters for ad targeting.

actual fun rememberInterstitialAd(adUnitId: String, onLoad: () -> Unit, onFailure: (Exception) -> Unit, customTargeting: CustomTargeting?): MutableState<InterstitialAdHandler>

Composable function to remember an interstitial ad.

This function creates and manages an InterstitialAdHandler instance, automatically loading an ad when the state is AdState.DISMISSED or AdState.NONE.

Return

A MutableState holding the InterstitialAdHandler. You can use this to control and observe the ad's state (e.g., to show the ad).

Parameters

adUnitId

The ad unit ID for the interstitial ad. Defaults to AdUnitId.INTERSTITIAL_DEFAULT.

onLoad

A callback function invoked when the ad is successfully loaded.

onFailure

A callback function invoked when ad loading fails, providing the Exception that occurred.