Unity Engine Douyin Mini-Game Release: All Pitfalls Successfully Navigated
Development Environment
Engine Version: Unity Engine 1.6.2 Professional Edition
Project Environment: Unity 1.62 + Instant Game (AutoStreaming) + Addressable
Preparation Work
Step 1: Switch to Minigame Mode
First, switch to Minigame mode, then switch to Douyin's development environment.
Important Note: After switching, there's no need to change StartSDK to TTSDK within ByteGame—the TTSDK environment is the default.
Be aware that this differs from Unity's traditional WebGL build and conversion process. Pay attention to these distinctions.
Step 2: Prepare Douyin Developer Tools
Download Page: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/dev-tools/developer-instrument-update-and-download
Troubleshooting Login Issues: If unable to log into Douyin Developer Tools, change the network connection DNS to manual configuration:
- Primary:
114.114.114.114 - Secondary:
8.8.8.8
Step 3: TTSDK Initialization
Functional Capabilities Overview
1. Sidebar
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/c-api/open-ability/sidebar
2. Sharing
Sharing functionality includes success and failure callbacks, differing from WeChat's implementation.
Important Note: Sharing materials can only be submitted in the Douyin backend after you submit your version.
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/c-api/open-ability/game-share/share-module
3. Rewarded Video Ads
Before creating a video ad, clear previous cache first.
Call ad.Destroy();
Then wait several frames before recreating.
Asynchronous One-Frame Wait: Use await Task.Yield(); — do NOT use await Task.Delay(1);
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/c-api/ads/rewardedvideoad
4. Add to Desktop
This feature is somewhat confusing, seemingly requiring iOS differentiation similar to JD. Note that UNITY_IOS may not necessarily work on mini-games. Refer to my previous article for differentiation methods. If unavailable, try switching SDK name prefixes.
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/guide/open-ability/get-app-links/add-desktop
5. Publisher Plan
This relates to user acquisition—no technical implementation details involved.
6. Subscription
Requires corresponding operational functionality to be enabled.
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/guide/open-ability/introduce
7. New Game Cold Start
No examples provided—not implemented in this project.
8. Live Streaming Companion Game Launch
Not implemented—no examples provided.
9. Recommended Feed Game Direct Play
Not implemented—no examples provided.
10. Interstitial Ads
Also known as "full-screen interstitial"—displays an advertisement in the middle of the screen.
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/guide/open-ability/ad/interstitial-ad
11. Rewarded Video Ads (IAA Industry)
For IAA (In-App Advertising) industry, no need to focus on eCPM values and callbacks. For money-earning gaming industry, no example content provided here—requires personal data debugging.
Recommendation: Use multiple IDs for random switching, 3-5 IDs should suffice.
Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/guide/open-ability/ad/incentive-ads
Packaging Process
This example uses Unity Engine + Instant Game (AutoStreaming) + Addressable.
Important Distinctions
- We're using the Minigame platform here, not traditional WebGL. Although both are technically WebGL, the operations differ significantly.
Douyin Documentation: https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/guide/game-engine/rd-to-SCgame/unity-game-access/install-connect/access-engine-advice/sc_webgl_access_flow#a6329718
Unity Official Documentation:
Key Point: Unlike WeChat mini-games, Douyin mini-games don't provide conversion options.
Addressable Configuration
First, the Instant Game UOS CDN address won't be automatically taken over by Addressable. Manual adjustment of Addressables Profiles' Remote.LoadPath address is required.
However, adjusting this often causes errors, and project references may show placeholder addresses like https://dummy.dummy.dummy/.
Adjustment Method:
Create a script in the project with the [Preserve] attribute. No need to mount the script on any object—simply placing it in the project suffices. Then apply the method shown in the reference image.
Replace the placeholder address with the CDN address. Finally, ensure a trailing slash is added after "content".
Note: No need to adjust Addressables Profiles.
Build Process
- First, fill in the Douyin Profile information
- After completion, directly build the package
- The build output contains Douyin-uploadable content
Douyin Profile Required Information:
The information at the bottom may require clicking a "Custom" option to expand.
Finally, click build to complete the package.
Final Configuration
Important: Douyin mini-games require URL whitelist configuration, similar to WeChat, but the https:// prefix must be removed from links. JD mini-games don't require whitelists.
Conclusion
Successfully deploying Unity games to the Douyin mini-game platform requires careful attention to configuration differences from traditional WebGL builds. The key distinctions lie in the Minigame mode setup, Addressable configuration adjustments, and platform-specific requirements like URL whitelisting.
Following this comprehensive guide helps avoid common pitfalls that developers encounter during their first Douyin mini-game deployment. The process, while different from WeChat mini-game publishing, becomes straightforward once the specific requirements are understood and properly configured.