loadNativeAd

abstract fun loadNativeAd(context: Context, adUnitId: String, callback: NativeAdProvider.NativeAdCallback, sizeHint: NativeAdSize = NativeAdSize.LARGE, templateLayoutResId: Int = 0)

Load a native ad.

Parameters

context

Activity or application context

adUnitId

Network-specific ad unit ID

callback

Receives the native ad View and an opaque reference

sizeHint

Hint for the desired ad view size (default: LARGE)

templateLayoutResId

Optional layout resource id of an AdMob-style native template (the same XML used by the AdMob renderer). When non-zero, providers that support it should inflate this exact layout and bind their assets to the standard asset ids (ad_headline, ad_body, ad_call_to_action, ad_app_icon, ad_advertiser, ad_media, ad_stars) so a fallback provider renders the same template as AdMob. Pass 0 (default) to use the provider's built-in sizeHint-based layout. It is an Int rather than a typed reference to keep this core module dependency-free.