getInstance

fun getInstance(applicationContext: Context, key: String? = DEFAULT_KEY, enableDebugLogging: Boolean = true): StorytellerAdMobModule

Returns a singleton instance of StorytellerAdMobModule.

This method ensures that only one instance of StorytellerAdMobModule is created per key. If an instance for the given key does not exist, a new one will be created and stored. Subsequent calls with the same key will return the existing instance.

Important: Only one ad module should be used at a time. If StorytellerGamModule is already initialized, a warning will be logged. Using both modules simultaneously results in undefined behavior.

Return

The singleton instance of StorytellerAdMobModule for the given key.

Parameters

applicationContext

The application Context. This is used to initialize the module. It's important to use the application context to avoid memory leaks.

key

An optional key to identify this instance. Defaults to "default".

enableDebugLogging

A Boolean flag to enable or disable debug logging. Defaults to true. When true, detailed logs will be outputted.