Storyteller Ad Mob Module
The Storyteller AdMob Module is responsible for integrating AdMob ads into the Storyteller SDK. It allows for fetching and displaying ads from AdMob within Storyteller Stories and Clips.
Important: Only one ad module should be used at a time. Do not use StorytellerAdMobModule together with StorytellerGamModule. The SDK behavior is undefined when both modules are registered.
To use this module, first obtain an instance using StorytellerAdMobModule.getInstance. Then, initialize it by calling the init method:
val adMobModule = StorytellerAdMobModule.getInstance(applicationContext).apply {
init(
adUnit = { adRequestInfo ->
when (adRequestInfo) {
is StorytellerAdRequestInfo.StoriesAdRequestInfo -> "ca-app-pub-xxx/stories"
else -> "ca-app-pub-xxx/clips"
}
}
)
}
Storyteller.modules = listOf(adMobModule)Key Differences from StorytellerGamModule
No custom native templates: AdMob does not support custom native ad templates
No key-value pair targeting: AdMob does not support direct KVP targeting like GAM
Separate loading paths: Native ads use AdLoader, banner ads use standalone AdView
Test Ad Unit IDs
For development and testing, use Google's official test ad unit IDs:
Native Advanced:
ca-app-pub-3940256099942544/2247696110Banner:
ca-app-pub-3940256099942544/6300978111
For more information on integrating ads, see the Storyteller Ads Documentation.
Parameters
The application context.
See also
Constructors
Functions
Initializes the Storyteller AdMob module with the necessary configuration for ad requests.