FAQ: TikTok SDK for Unity
Start with the SDK version, C# symbol, CanIUse result, and real-device environment. Then continue with the dedicated capability guide for the business flow.
Why can I not find a method from this document in my project?
Confirm that the project uses com.tiktok.minigame@1.1.6-Beta and imports TTSDK. If the method came from another platform SDK, an old attachment, or a legacy example, replace it with the entry point in this reference. If compilation still fails, provide the Unity version, SDK version, full compiler error, and conflicting plugin list.
Why does an API compile but report unsupported or fail on a real device?
Compilation only confirms that the installed assembly contains the method. Check the corresponding CanIUse property, then verify the TikTok App version, Mini Games Runtime, region, permissions, and capability configuration. Reproduce the issue through DevTool and real-device preview. All prerequisites in the dedicated capability guide still apply.
Why does an old example use different callback parameters?
The old example may target a different SDK version. Use the SDK installed in your project and the matching reference. Do not keep an old callback and change only the method name. After an upgrade, recompile and validate success, failure, and cancellation paths in DevTool and on a real device.
Does this document contain the complete Login, Authorization, IAP, and IAA integration flows?
No. This reference covers C# entry points and SDK contracts. Use the dedicated integration guides for platform configuration, server-side interaction, permission requests, ad-unit or product setup, real-environment validation, and troubleshooting.
C# call pattern examples
These examples show the minimum C# call pattern. A real game must also implement state handling, failure paths, object cleanup, and all requirements from the dedicated capability guide.
Login example
if (!CanIUse.Login)
{
UnityEngine.Debug.LogError("Login is not available in the current runtime.");
return;
}
TT.Login(
code =>
{
// Send the temporary code to your game server.
UnityEngine.Debug.Log($"Login code: {code}");
},
errMsg =>
{
UnityEngine.Debug.LogError($"Login failed: {errMsg}");
});Note: Login returns only a temporary code. Follow the Login Integration Guide and exchange the code on your game server. Never store the client secret in the mini game frontend.
Rewarded video ad example
var rewardedAd = TT.CreateRewardedVideoAd(
new CreateRewardedVideoAdParam
{
AdUnitId = "your_rewarded_ad_unit_id"
});
rewardedAd.OnLoad += () =>
{
rewardedAd.Show();
};
rewardedAd.OnError += (code, message) =>
{
UnityEngine.Debug.LogError($"Ad error {code}: {message}");
};
rewardedAd.OnClose += isEnded =>
{
if (isEnded)
{
GrantReward();
}
};
rewardedAd.Load();Local key-value storage example
TT.PlayerPrefs.SetInt("level", 12);
TT.PlayerPrefs.Save();
int level = TT.PlayerPrefs.GetInt("level", 1);