hz-platform-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHorizon Platform SDK - Android/Kotlin Integration Guide
Horizon Platform SDK - Android/Kotlin集成指南
When to Use
适用场景
Use this skill when a developer:
- Wants to integrate any Horizon Platform SDK feature in a Meta Quest Android/Kotlin application
- Asks about setup, initialization, or dependencies for the SDK
- Needs help with a specific public platform API (achievements, IAP, users, etc.)
- Is troubleshooting errors or status codes from any SDK package
- Asks about HorizonServiceConnection, entitlements, or HzPlatformService
当开发者遇到以下情况时,可使用本技能:
- 希望在Meta Quest Android/Kotlin应用中集成Horizon Platform SDK的任意功能
- 询问SDK的设置、初始化或依赖相关问题
- 需要特定公开平台API(成就、IAP、用户等)的使用帮助
- 排查任意SDK包的错误或状态码问题
- 询问HorizonServiceConnection、Entitlements或HzPlatformService相关内容
Quick Start
快速开始
Available APIs
可用API
| Feature | Reference | Description |
|---|---|---|
| Abuse Report | | Listen for report button events in the system panel |
| Achievements | | Unlock, track progress, and query simple/count/bitfield achievements |
| Application | | Get app version, launch other apps, manage self-update downloads |
| Application Lifecycle | | Detect launch type, handle deeplinks, log deeplink results |
| Asset File | | List, download, cancel, and delete downloadable asset files (DLC) |
| Consent | | Check and launch user consent flows |
| Device Application Integrity | | Verify device and app integrity tokens |
| Entitlements | | Verify app purchase legitimacy and user authorization |
| Group Presence | | Set/clear presence, manage sessions, send invites, launch panels |
| In-App Purchases (IAP) | | Retrieve products, purchase history, checkout flow, consume purchases |
| Language Pack | | Get/set language packs, track localization downloads |
| Leaderboards | | Retrieve leaderboard info, fetch/write entries with filtering |
| Notifications | | Send device notifications with actions and icons |
| Rate and Review | | Check eligibility and launch the rating/review UI |
| Rich Presence | | Set/clear rich presence status and destinations (deprecated; prefer group-presence) |
| User Age Category | | Query user age group and report age categories |
| Users | | Retrieve user profiles, friends, access tokens, identity verification |
| 功能 | 参考标识 | 描述 |
|---|---|---|
| 举报滥用 | | 监听系统面板中的举报按钮事件 |
| 成就 | | 解锁、跟踪进度并查询简单/计数/位字段类型成就 |
| 应用 | | 获取应用版本、启动其他应用、管理自动更新下载 |
| 应用生命周期 | | 检测启动类型、处理深度链接、记录深度链接结果 |
| 资产文件 | | 列出、下载、取消及删除可下载资产文件(DLC) |
| 授权同意 | | 检查并启动用户授权同意流程 |
| 设备应用完整性 | | 验证设备与应用完整性令牌 |
| 权限 | | 验证应用购买合法性及用户授权 |
| 群组状态 | | 设置/清除状态、管理会话、发送邀请、启动面板 |
| 应用内购买(IAP) | | 获取产品信息、购买历史、结账流程、消费已购项目 |
| 语言包 | | 获取/设置语言包、跟踪本地化下载 |
| 排行榜 | | 获取排行榜信息、筛选查询/写入榜单条目 |
| 通知 | | 发送带操作和图标的设备通知 |
| 评分与评价 | | 检查资格并启动评分/评价界面 |
| 富状态 | | 设置/清除富状态及目标地址(已弃用;推荐使用group-presence) |
| 用户年龄分类 | | 查询用户年龄组并上报年龄分类 |
| 用户 | | 获取用户资料、好友列表、访问令牌、身份验证 |
How to Use
使用方法
- First, read for shared setup instructions, initialization code, and common status codes that apply to all APIs.
references/common-setup.md - Then, read the specific reference file for the API you need (e.g., for in-app purchases).
references/iap.md
Each reference file contains only the package-specific content: API operations, data types, examples, and package-specific notes. The common setup and error codes are centralized in to avoid duplication.
common-setup.md- 首先,阅读获取通用设置说明、初始化代码及适用于所有API的通用状态码。
references/common-setup.md - 然后,阅读对应API的特定参考文件(例如,应用内购买请查看)。
references/iap.md
每个参考文件仅包含该包的专属内容:API操作、数据类型、示例及包专属说明。通用设置和错误码集中在中,避免重复内容。
common-setup.md