Files
Commercialization.topon/Assets/Samples/IAAAdDebugSample/README.md
2026-04-22 17:44:49 +08:00

113 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IAA Ad Debug Sample
## 文件位置
- 场景:
- `Assets/Samples/IAAAdDebugSample/Scenes/IAAAdDebugSample.unity`
- 示例配置:
- `Assets/Samples/IAAAdDebugSample/Configs/IAAAdDebugSampleConfig.asset`
## 使用步骤
1. 打开示例配置资产 `IAAAdDebugSampleConfig.asset`
2. 填入以下字段:
- `Id` = Taku AppId
- `Key` = Taku AppKey
- `BaseAwardAdKeyValue.value` = 激励视频广告位ID
- `BaseInteractionAdKeyValue.value` = 插屏广告位ID
3. 打开示例场景 `IAAAdDebugSample.unity`
4. 运行到 Android 手机测试
## 当前默认策略
- SDK Debug
- `topon.debug=true`
- `topon.auto_open_debugger_ui=false`
- 激励视频
- 自动加载:开启
- 初始化预热:开启
- 最大加载尝试次数3
- 首轮失败补偿1000ms
- 插屏广告
- 自动加载:开启
- 初始化预热:开启
- 最大加载尝试次数2
- 首轮失败补偿500ms
## 场景里的 IMGUI 面板支持
- 初始化 ADManager
- 打开官方 DebugUI
- 手动 Enter Rewarded / Interstitial Scene
- 手动 Load 激励 / 插屏
- AsyncPlay 激励 / 插屏
- 查看当前屏幕分辨率和 SafeArea
- 查看当前策略状态
- 手动刷新状态快照,避免高频状态查询刷满日志
- 查看 Rewarded / Interstitial 的状态 JSON
- 一键复制全部日志
- 自动写入本地 session log 文件
- 一键导出当前面板可见日志到单独文件
- 一键复制日志文件路径
- 查看诊断日志
## 关于 Debug 模式
- `topon.debug=true` 只用于打开 SDK 调试日志
- 不会再因为 debug 模式自动弹出官方 DebugUI
- 官方 DebugUI 改为手动点击 `Open DebugUI`
## 场景到达测试方式
推荐验证两条链路:
1. 先点击 `Enter Rewarded Scene`,再点击 `Async Play Rewarded`
2. 不点击 `Enter Rewarded Scene`,直接点击 `Async Play Rewarded`
当前实现逻辑:
- 如果提前调用了 `EnterAdScenario`
- 播放时不会重复上报场景
- 如果没有提前调用
- 播放时不再自动补“场景到达”统计
## 建议测试流程
1. 打开场景并运行到真机
2. 点击 `Initialize ADManager`
3. 点击 `Open DebugUI`,确认 SDK Debug 面板可打开
4. 点击 `Enter Rewarded Scene`
5. 点击 `Async Play Rewarded`
6. 点击 `Enter Interstitial Scene`
7. 点击 `Async Play Interstitial`
8. 点击 `Copy All Logs`
9. 将日志直接粘贴给 Codex 分析
如果日志太长,不适合走剪贴板:
1. 点击 `Export Logs To File`
2. 点击 `Copy Log File Path`
3. 到真机的 `Application.persistentDataPath/IAAAdDebugLogs` 下取出日志文件
4. 将文件内容发给 Codex 分析
## 关于分辨率
当前 IMGUI 布局按 `1080 x 2340` 纵向手机做参考设计,并根据 `SafeArea` 自动缩放,适合作为真机调试面板。
## 关于签名
当前示例只负责在 Unity 内和 Android 调试时验证广告链路。
- 不需要官方提供签名
- 只有在你要正式导出 APK / AAB 时,才需要你自己的包名和签名配置
## 关于日志文件位置
- 运行时会自动创建一份 session log
- 目录:`Application.persistentDataPath/IAAAdDebugLogs`
- Android 上通常类似:
- `/storage/emulated/0/Android/data/<包名>/files/IAAAdDebugLogs`
- 当前测试包名是:
- `com.foldcc.starveg`