| name | f8-features-sdkmanager-workflow |
| description | Use when implementing or troubleshooting SDKManager feature workflows — native platform integration, login, pay, ads, and platform-specific setup in F8Framework. |
SDKManager Feature Workflow
⚠️ IMPORTANT: Before using this feature, you MUST formally initialize F8Framework in the launch sequence. Ensure ModuleCenter.Initialize(this); has run first, then create the required module, for example FF8.SDK = ModuleCenter.CreateModule<SDKManager>();.
Use this skill when
- The task is about SDK integration for Android, iOS, WebGL, or mini-games.
- The user asks about login, payment, ads, or native platform interaction.
- Setting up Jenkins CI/CD for automated builds.
Path resolution
- Prefer project source at Assets/F8Framework.
- For usage docs, read: Assets/F8Framework/Tests/SDKManager/README.md
Sources of truth
- Runtime module: Assets/F8Framework/Runtime/SDKManager
- Android plugins: Assets/F8Framework/Runtime/SDKManager/Plugins_Android
- iOS plugins: Assets/F8Framework/Plugins/iOS/SDKManager
- Test docs: Assets/F8Framework/Tests/SDKManager
Key classes and interfaces
| Class | Role |
|---|
SDKManager | Core module. Access via FF8.SDK. |
API quick reference
FF8.SDK.SDKStart("platformId", "channelId");
FF8.SDK.SDKLogin();
FF8.SDK.SDKLogout();
FF8.SDK.SDKSwitchAccount();
FF8.SDK.SDKLoadVideoAd("adId", "adType");
FF8.SDK.SDKShowVideoAd("adId", "adType");
FF8.SDK.SDKPay("serverNum", "serverName", "playerId",
"playerName", "amount", "extra", "orderId",
"productName", "productContent", "playerLevel",
"sign", "guid");
FF8.SDK.SDKUpdateRole("scenes", "serverId", "serverName",
"roleId", "roleName", "roleLevel", "roleCTime",
"rolePower", "guid");
FF8.SDK.SDKExitGame();
FF8.SDK.SDKToast("Native Toast");
Platform setup
Android
- Choose correct Gradle version directory based on Unity version.
- Add
.xml and .aar extensions respectively.
- Rebuild when switching Unity versions.
- Android Gradle version support: 6.1.1 (2021/2022), 7.6 (2023), 8.1+ (Unity 6).
iOS
- Modify
F8SDKInterfaceUnity.h and F8SDKInterfaceUnity.mm for SDK integration.
WebGL
- Cannot use sync AB loading. Use Resources for sync or async AB.
- Configure in F5: enable MD5 AB names, force remote loading, disable cache on WebGL.
WeChat Mini Games
- Remove
LitJson.dll from WX-WASM-SDK-V2.
- Add F8Framework
LitJson reference to WX assemblies.
- Configure CDN address and Bundle Path Identifier (default
StreamingAssets, change to AssetBundles).
- Enable "Force Remote Loading" and "Disable Cache" in F5 build tool for mini-games.
Jenkins CI
- Install Java SDK + Jenkins.
- Install Unity3d plugin in Jenkins.
- Configure Unity path in Jenkins Tools.
- Copy
config.xml to Jenkins job directory.
- Configure build parameters matching F5 build tool settings.
Workflow
- Call
SDKStart() to initialize the platform SDK.
- Implement login flow with
SDKLogin().
- Handle payment via
SDKPay() with server verification.
- Show ads via
SDKLoadVideoAd() + SDKShowVideoAd().
- Update user info with
SDKUpdateRole() for analytics.
- For platform-specific deployment, follow per-platform setup above.
Common error handling
| Error | Cause | Solution |
|---|
| Android build fails | Wrong Gradle/AAR version | Match Gradle version to Unity version |
| iOS callback not received | Missing .mm implementation | Check F8SDKInterfaceUnity.mm |
| WebGL AB load fails | Sync loading not supported | Use async loading or Resources |
| WeChat LitJson conflict | Duplicate LitJson.dll | Remove from WX-WASM-SDK-V2 |
Cross-module dependencies
- Build: SDK setup affects build configuration.
- AssetManager: WebGL/mini-game asset loading has special requirements.
Output checklist
- Platform SDK initialized.
- Native integration files configured.
- Platform-specific build tested.
- Validation status and remaining risks.