initialize

suspend fun initialize(config: GamStreamConfig)

Initialize a fresh IMA pod-serving session and suspend until the stream id is available (or the request errors). Always resets any prior session.

Runs on the MAIN thread: IMA builds Handlers internally while creating the loader and display container, so on a thread with no Looper it throws "Attempt to read from field android.os.Looper.mQueue on a null object reference" and the session never opens — after which every GAM pod asset fails instantly and the break collapses in milliseconds. This is the counterpart of the Swift twin's @MainActor.

The native Android agent happened to drive the SDK on Dispatchers.Main and never hit it; the React Native bridge used Dispatchers.Default and hit it on every session.