NativeAd

fun NativeAd(activity: Any?, nativeAdTemplate: @Composable (NativeAdData) -> Unit, adUnitId: String = AdUnitId.NATIVE_DEFAULT, onDismissed: () -> Unit = {}, onShown: () -> Unit = {}, onImpression: () -> Unit = {}, onClick: () -> Unit = {}, onFailure: (Exception) -> Unit = {}, onLoad: () -> Unit = {})

A composable that displays a native ad.

Parameters

activity

the current Activity (only needed for Android Impl)

nativeAdTemplate

the composable that will be used to display the native ad

adUnitId

the ad unit ID for the native ad

onDismissed

a callback that will be invoked when the ad is dismissed

onShown

a callback that will be invoked when the ad is shown

onImpression

a callback that will be invoked when an impression is recorded for the ad

onClick

a callback that will be invoked when the ad is clicked

onFailure

a callback that will be invoked when the ad fails to load

onLoad

a callback that will be invoked when the ad has loaded


fun NativeAd(loadedAd: NativeAdHandler, nativeAdTemplate: @Composable (NativeAdData) -> Unit)

A composable that displays a native ad.

Parameters

loadedAd

the pre-loaded native ad

nativeAdTemplate

the composable that will be used to display the native ad