hz-platform-sdk

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Horizon 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

FeatureReferenceDescription
Abuse Report
abuse-report
Listen for report button events in the system panel
Achievements
achievements
Unlock, track progress, and query simple/count/bitfield achievements
Application
application
Get app version, launch other apps, manage self-update downloads
Application Lifecycle
application-lifecycle
Detect launch type, handle deeplinks, log deeplink results
Asset File
asset-file
List, download, cancel, and delete downloadable asset files (DLC)
Consent
consent
Check and launch user consent flows
Device Application Integrity
device-application-integrity
Verify device and app integrity tokens
Entitlements
entitlements
Verify app purchase legitimacy and user authorization
Group Presence
group-presence
Set/clear presence, manage sessions, send invites, launch panels
In-App Purchases (IAP)
iap
Retrieve products, purchase history, checkout flow, consume purchases
Language Pack
language-pack
Get/set language packs, track localization downloads
Leaderboards
leaderboards
Retrieve leaderboard info, fetch/write entries with filtering
Notifications
notifications
Send device notifications with actions and icons
Rate and Review
rate-and-review
Check eligibility and launch the rating/review UI
Rich Presence
rich-presence
Set/clear rich presence status and destinations (deprecated; prefer group-presence)
User Age Category
user-age-category
Query user age group and report age categories
Users
users
Retrieve user profiles, friends, access tokens, identity verification
功能参考标识描述
举报滥用
abuse-report
监听系统面板中的举报按钮事件
成就
achievements
解锁、跟踪进度并查询简单/计数/位字段类型成就
应用
application
获取应用版本、启动其他应用、管理自动更新下载
应用生命周期
application-lifecycle
检测启动类型、处理深度链接、记录深度链接结果
资产文件
asset-file
列出、下载、取消及删除可下载资产文件(DLC)
授权同意
consent
检查并启动用户授权同意流程
设备应用完整性
device-application-integrity
验证设备与应用完整性令牌
权限
entitlements
验证应用购买合法性及用户授权
群组状态
group-presence
设置/清除状态、管理会话、发送邀请、启动面板
应用内购买(IAP)
iap
获取产品信息、购买历史、结账流程、消费已购项目
语言包
language-pack
获取/设置语言包、跟踪本地化下载
排行榜
leaderboards
获取排行榜信息、筛选查询/写入榜单条目
通知
notifications
发送带操作和图标的设备通知
评分与评价
rate-and-review
检查资格并启动评分/评价界面
富状态
rich-presence
设置/清除富状态及目标地址(已弃用;推荐使用group-presence)
用户年龄分类
user-age-category
查询用户年龄组并上报年龄分类
用户
users
获取用户资料、好友列表、访问令牌、身份验证

How to Use

使用方法

  1. First, read
    references/common-setup.md
    for shared setup instructions, initialization code, and common status codes that apply to all APIs.
  2. Then, read the specific reference file for the API you need (e.g.,
    references/iap.md
    for in-app purchases).
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
common-setup.md
to avoid duplication.
  1. 首先,阅读
    references/common-setup.md
    获取通用设置说明、初始化代码及适用于所有API的通用状态码。
  2. 然后,阅读对应API的特定参考文件(例如,应用内购买请查看
    references/iap.md
    )。
每个参考文件仅包含该包的专属内容:API操作、数据类型、示例及包专属说明。通用设置和错误码集中在
common-setup.md
中,避免重复内容。