Note: For cloud mini games, you must call preInitSeSdk to pre-initialize the SDK on every cold start.
Example Code:
if (StarkSDK.IsCloudInitOver)
{
InitSDKCallback();
}
else
{
StarkSDK.StarkCloudInitOverEvent = () => { InitSDKCallback();};
}
public void InitSDKCallback()
{
SEConfig seConfig = new SEConfig();
MiniGameInitParams initParams = new MiniGameInitParams();
initParams.anonymous_openid = "your anonymous_openid";
initParams.unionid = "your unionid";
initParams.openid = "your openid";
seConfig.miniGameInitParams = initParams;
seConfig.logEnabled = true;
//Pre-initialization
SolarEngine.Analytics.preInitSeSdk("appkey");
SolarEngine.Analytics.initSeSdk("appkey",seConfig);
}Simply add the SOLARENGINE_BYTEDANCE_CLOUD macro to package the APK for the Douyin Cloud game.
The SE Android SDK might affect the packaging of the Douyin Cloud game APK. We provide a function to remove the Android SDK with one click.
Click [SolarEngineSDK --> SDK Edit Settings] to open the SolarEngineSettings panel.
Change the setting
to a checked state, then click Apply.
If you need to run the mini game's internal logic within the Unity Editor environment (using the local debugging provided by the cloud game side), add the SE_DEV macro definition. Please ensure this macro definition is removed when building the APK.