initialize

abstract suspend fun initialize(config: AdConfig, consentMode: ConsentMode = ConsentMode.GatherBeforeInitialize): AdManagerStatus(source)

Initializes the Google Mobile Ads SDK with the given config and consentMode.

Return

The resulting AdManagerStatus after initialization completes.

Parameters

config

SDK configuration including app ids, test mode, and request defaults.

consentMode

Consent-gathering strategy. ConsentMode.GatherBeforeInitialize requests a UMP update and shows the consent form if required, then initializes ads if ConsentController.canRequestAds is true. ConsentMode.InitializeOnlyIfAlreadyAllowed updates UMP but never shows a form. ConsentMode.SkipConsent bypasses UMP entirely.