> ## Documentation Index
> Fetch the complete documentation index at: https://docs.almedia.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Threading

> How to integrate the Almedia SDK — synced from the source repository.

Call every SDK method on the **Unity main thread**. This includes `Initialize`, `ShowLink`, `StartLinking`, `ShowRewardHub` and `ShowOffer`. A call from another thread can fail. Callbacks from other SDKs, such as remote config, login or ads, can run on a background thread. Move to the main thread before you call the SDK from one.

Every public event on `Almedia` - `OnStatusChanged`, `OnLinkCompleted`, `OnNotificationsReceived`, `OnInGameRewardGrantRequested`, `OnProgressUpdated`, `OnTaskCompleted`, `OnBalanceChanged`, `OnErrorOccurred`, `OnScreenPresented`, `OnScreenDismissed`, `OnLog` - fires on the **Unity main thread**. Handlers can touch `GetComponent`, `transform`, `UnityEngine.UI` elements, and any other Unity API directly. They can also call SDK methods.

Internally, the native SDKs perform I/O off the main thread and post results back via `UnitySendMessage`, which Unity always delivers on the main thread. The editor mock bridge uses coroutines, which run on the main thread as well, so the threading contract is identical in the editor and on device.

`UnitySendMessage` addresses its target by name. The SDK receives on a persistent GameObject it creates at `Initialize`, named `[Almedia SDK] Bridge` and hidden from the Hierarchy. That name is reserved: do not give any object in your project the same name, and do not rename, destroy or deactivate the SDK's object.

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.