Table of Contents

Manual SDK Initialization

VERSION

com.homagames.sdk-core 5.0.0

Some games do require delaying or controlling Homa SDK initialization. For example, to provide Homa SDK with server-side authentication player identifier.

Homa SDK initializes in two distinct phases:

  • The pre-initialization, that will instantiate the services, and initialize low level services like Logger and Configuration. It will also initialize the Privacy service and show its pop-up if needed.
  • The initialization phase, that actually starts the SDK. It initializes the remaining services, like ads and analytics.
Note

HomaBelly.Ads is instantiated during the initialization phase. It will be null before that.

To enable manual SDK initialization, add the HOMA_BELLY_MANUAL_INITIALIZATION define symbol to your Unity project. This will prevent the initialization phase to run automatically. You will have to invoke HomaBelly.Initialization.InitializeAsync(); to start it.

[!Info] Delaying the initialization phase will let you provide a player ID for Homa SDK to use. You can provide it using the Identifiers.SetHomaGamesId("player_id", true); method.

Example:

// Listen to games' login system to get the ID and set it
var playerId = "123456789";
Identifiers.SetHomaGamesId(playerId, true);

// Initialize Homa SDK with the above informed player ID
HomaBelly.Initialization.InitializeAsync();