rememberInterstitialAd

@Composable
actual fun rememberInterstitialAd(adUnitId: String, onLoad: () -> Unit, onFailure: (Exception) -> Unit): 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.


@Composable
actual fun rememberInterstitialAd(activity: Any?, adUnitId: String, onLoad: () -> Unit, onFailure: (Exception) -> Unit): MutableState<InterstitialAdHandler>

Deprecated

The `activity` argument is no longer required as of v1.1.0-beta01

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

activity

The activity context, required for ad loading.

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.

@Composable
expect fun rememberInterstitialAd(adUnitId: String = AdUnitId.INTERSTITIAL_DEFAULT, onLoad: () -> Unit = {}, onFailure: (Exception) -> Unit = {}): 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.


@Composable
expect fun rememberInterstitialAd(activity: Any?, adUnitId: String = AdUnitId.INTERSTITIAL_DEFAULT, onLoad: () -> Unit = {}, onFailure: (Exception) -> Unit = {}): MutableState<InterstitialAdHandler>

Deprecated

The `activity` argument is no longer required as of v1.1.0-beta01

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

activity

The activity context, required for ad loading.

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.

@Composable
actual fun rememberInterstitialAd(adUnitId: String, onLoad: () -> Unit, onFailure: (Exception) -> Unit): 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.


@Composable
actual fun rememberInterstitialAd(activity: Any?, adUnitId: String, onLoad: () -> Unit, onFailure: (Exception) -> Unit): MutableState<InterstitialAdHandler>

Deprecated

The `activity` argument is no longer required as of v1.1.0-beta01

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

activity

The activity context, required for ad loading.

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.