跳到主要内容

Unity API

对 Combo SDK for Unity API 进行以下汇总,API 具体的实现细节请查阅开发指南。

账号与登录

APISupported PlatformsDescription
LoginAndroid iOS Windows WebGL HarmonyOS登录
LogoutAndroid iOS Windows HarmonyOS登出
GetLoginInfoAndroid iOS Windows WebGL HarmonyOS获取用户信息
OnKickOutAndroid iOS Windows HarmonyOS踢出用户回调
ResetGuestAndroid iOS抹除当前设备存储的游客账号数据

内购与支付

APISupported PlatformsDescription
PurchaseAndroid iOS Windows WebGL HarmonyOS发起购买

游戏内广告

APISupported PlatformsDescription
PreloadAdAndroid iOS预加载广告
ShowAdAndroid iOS展示广告

游戏内分享

APISupported PlatformsDescription
ShareAndroid iOS HarmonyOS图片资源、视频资源及链接分享
GetAvailableShareTargetsAndroid iOS HarmonyOS获取可用的分享方式

游戏联运

APISupported PlatformsDescription
ReportCreateRoleAndroid HarmonyOS上报创建角色
ReportEnterGameAndroid HarmonyOS上报进入游戏
QuitAndroid HarmonyOS退出游戏

游戏更新

APISupported PlatformsDescription
UpdateGameAndroid HarmonyOS使用发行版本自有更新唤起功能
GetDownloadUrlAndroid iOS Windows HarmonyOS获取更新包下载地址

联系客服

APISupported PlatformsDescription
ContactSupportAndroid iOS Windows WebGL通过 SDK 内置的 WebView 在游戏内打开世游客服中心

游戏 Web 页

APISupported PlatformsDescription
OpenGameUrlAndroid iOS Windows HarmonyOS在游戏内通过 Combo SDK 内置的 WebView 打开特定的 Web 页面
APISupported PlatformsDescription
OpenShortLinkAndroid iOS Windows HarmonyOS通过 Combo SDK 内置的 WebView 打开一个短链接

游戏公告

APISupported PlatformsDescription
CheckAnnouncementsAndroid iOS Windows HarmonyOS检查是否存在新的游戏公告
OpenAnnouncementsAndroid iOS Windows HarmonyOS打开游戏公告

游戏内举报

APISupported PlatformsDescription
ComplainAndroid iOS Windows HarmonyOS游戏内举报
APISupported PlatformsDescription
ManageAccountAndroid iOS Windows打开通行证网站首页
ChangePasswordAndroid iOS Windows打开通行证网站的修改密码页面
DeleteAccountAndroid iOS Windows打开通行证网站的删除账号页面

投放归因

APISupported PlatformsDescription
PromoPseudoPurchaseAndroid伪付费上报

多语言

APISupported PlatformsDescription
LanguagePreferenceAndroid iOS Windows设置或获取 SDK 当前语言偏好
LanguageCodeAndroid iOS Windows获取 SDK 当前使用的语言代码

礼包码

APISupported PlatformsDescription
RedeemGiftCodeAndroid iOS Windows HarmonyOS兑换礼包码

应用链接

APISupported PlatformsDescription
OnDeepLinkActivatedHarmonyOS应用通过 HarmonyOS 平台的深度链接唤起时,接收回调并获取链接参数

其他

APISupported PlatformsDescription
GetDistroAndroid iOS Windows WebGL HarmonyOS获取发行版本标识
GetVariantAndroid获取分包标识,在不支持该 API 的平台调用时将返回 null
OpenAppSettingsAndroid iOS HarmonyOS修改应用系统权限设置
GetGameIdAndroid iOS Windows WebGL HarmonyOS获取由世游侧为游戏分配,用于标识游戏的业务代号
GetDeviceIdAndroid iOS Windows WebGL HarmonyOS获取设备 ID
GetVersionAndroid iOS Windows WebGL HarmonyOS获取 Combo SDK for Unity 版本信息
GetVersionNativeAndroid iOS Windows HarmonyOS获取 Combo SDK for Android / iOS / Windows / HarmonyOS 版本信息
IsFeatureAvailableAndroid iOS Windows WebGL HarmonyOS判断具体功能是否可用
- UPDATE_GAME (游戏更新)
- QUIT (退出游戏)
- PRODUCT_QUANTITY (渠道商店支持选择商品数量)
- SEAYOO_ACCOUNT (世游通行证相关功能)
- CONTACT_SUPPORT (联系客服)