AdUnitId

actual object AdUnitId

A utility object for providing ad unit IDs.

expect object AdUnitId

A utility object for providing ad unit IDs.

This object provides a way to manage and access AdMob AdUnitIds for different ad types and platforms. It includes a utility function for selecting the appropriate AdUnitId based on the current platform (Android or iOS) and provides default AdUnitIds for common ad formats.

See also

For selecting AdUnitIds dynamically based on the platform.

Default AdUnitId for Banner ads.

Default AdUnitId for Interstitial ads.

Default AdUnitId for Rewarded Interstitial ads.

Default AdUnitId for Rewarded ads.

actual object AdUnitId

Properties

Link copied to clipboard
actual const val BANNER_DEFAULT: String

The default ad unit ID for banner ads.

The default test ad unit ID for banner ads.

actual const val BANNER_DEFAULT: String
Link copied to clipboard
actual const val INTERSTITIAL_DEFAULT: String

The default ad unit ID for interstitial ads.

The default test ad unit ID for interstitial ads.

actual const val INTERSTITIAL_DEFAULT: String
Link copied to clipboard
actual const val NATIVE_DEFAULT: String

The default ad unit ID for native ads.

The default test ad unit ID for native ads.

actual const val NATIVE_DEFAULT: String
Link copied to clipboard
actual const val REWARDED_DEFAULT: String

The default ad unit ID for rewarded ads.

The default test ad unit ID for rewarded ads.

actual const val REWARDED_DEFAULT: String
Link copied to clipboard

The default ad unit ID for rewarded interstitial ads.

The default test ad unit ID for rewarded interstitial ads.

Functions

Link copied to clipboard
actual fun autoSelect(androidAdUnitId: String?, iosAdUnitId: String?): String

Selects the appropriate ad unit ID for the current platform. On Android, it returns the androidAdUnitId.

expect fun autoSelect(androidAdUnitId: String? = null, iosAdUnitId: String? = null): String

Selects the appropriate ad unit ID based on the platform at runtime.

actual fun autoSelect(androidAdUnitId: String?, iosAdUnitId: String?): String