Unity Integration Guide
Everything you need to bring VNGGames to your game: sign-in, in-app purchase, analytics, ads, and player engagement: in one complete reference. Every method spells out its inputs and outputs field by field, and each one is directly linkable so you can jump straight to the call you need.
打造遊戲接入 VNGGames 所需的一切: 登入、應用程式內購買、分析、廣告與玩家互動: 全部整合於一份完整參考中。每個方法都逐一欄位說明其輸入與輸出,且每個方法都可直接連結,讓你能快速跳到所需的呼叫。
打造游戏接入 VNGGames 所需的一切: 登录、应用内购买、分析、广告与玩家互动: 全部整合于一份完整参考中。每个方法都逐一字段说明其输入与输出,且每个方法都可直接链接,让你能快速跳到所需的调用。
Get started
Prerequisites
- VNGGames SDK package: obtain the latest VNGGames SDK zip file.
- Unity: 2021, 2022, 2023, or 6 (LTS).
- Dependency:
com.unity.nuget.newtonsoft-json3.0.1(pulled in by the package). - Build tooling: the iOS export needs macOS + Xcode 26+ (target iOS 13+). The Android export needs JDK 17, the Android SDK (API 23+ / Target 36), NDK 28+, AGP 8.5.1, a signing keystore, and Nexus access for
vgsdk-unity+vgsdk-vn. Per-game config files (VGSDKService-Info.plist,pass-services.json,google-services.json) come from the OP Tool.
- VNGGames SDK 套件: 取得最新的 VNGGames SDK zip 檔案。
- Unity: 2021、2022、2023 或 6(LTS)。
- 相依套件:
com.unity.nuget.newtonsoft-json3.0.1(由套件自動引入)。 - 建置工具: iOS 匯出需要 macOS + Xcode 26+(目標 iOS 13+)。Android 匯出需要 JDK 17、Android SDK(API 23+/Target 36)、NDK 28+、AGP 8.5.1、簽署用 keystore,以及可解析
vgsdk-unity+vgsdk-vn的 Nexus 存取權限。各遊戲的設定檔(VGSDKService-Info.plist、pass-services.json、google-services.json)由 OP Tool 提供。
- VNGGames SDK 包: 获取最新的 VNGGames SDK zip 文件。
- Unity: 2021、2022、2023 或 6(LTS)。
- 依赖包:
com.unity.nuget.newtonsoft-json3.0.1(由包自动引入)。 - 构建工具: iOS 导出需要 macOS + Xcode 26+(目标 iOS 13+)。Android 导出需要 JDK 17、Android SDK(API 23+/Target 36)、NDK 28+、AGP 8.5.1、签名用 keystore,以及可解析
vgsdk-unity+vgsdk-vn的 Nexus 访问权限。各游戏的配置文件(VGSDKService-Info.plist、pass-services.json、google-services.json)由 OP Tool 提供。
Dependencies
Every third-party library the SDK brings into your build, one tab per build target. The Unity package itself adds only Newtonsoft.Json. The rest arrive with the natives it embeds: the pinned iOS framework set lands in your exported Xcode project, and the vgsdk-service Gradle plugin adds the Android coordinates to your exported Android project.
SDK 帶進你建置中的所有第三方函式庫,每個建置目標一個分頁。Unity 套件本身只加入 Newtonsoft.Json,其餘皆隨它嵌入的原生 SDK 一併帶入:已固定版本的 iOS framework 會出現在你匯出的 Xcode 專案中,而 vgsdk-service Gradle 外掛會將 Android 座標加入你匯出的 Android 專案。
SDK 带进你构建中的所有第三方库,每个构建目标一个标签页。Unity 包本身只加入 Newtonsoft.Json,其余皆随它嵌入的原生 SDK 一并带入:已固定版本的 iOS framework 会出现在你导出的 Xcode 项目中,而 vgsdk-service Gradle 插件会将 Android 坐标加入你导出的 Android 项目。
| Library | Version | Group |
|---|---|---|
com.unity.nuget.newtonsoft-json | 3.0.1 | Core |
| 函式庫 | 版本 | 分組 |
|---|---|---|
com.unity.nuget.newtonsoft-json | 3.0.1 | 核心 |
| 库 | 版本 | 分组 |
|---|---|---|
com.unity.nuget.newtonsoft-json | 3.0.1 | 核心 |
Installation
Add the SDK package to your Unity game, then export a native iOS or Android project. Run the helper scripts from the unzipped bundle folder (where add-vgsdk-package.sh and the export scripts live).
將 SDK 套件加入你的 Unity 遊戲,然後匯出原生 iOS 或 Android 專案。請在解壓後的發佈包目錄(add-vgsdk-package.sh 與匯出指令碼所在處)執行這些輔助指令碼。
将 SDK 包添加到你的 Unity 游戏,然后导出原生 iOS 或 Android 工程。请在解压后的分发包目录(add-vgsdk-package.sh 与导出脚本所在处)运行这些辅助脚本。
Add the SDK package
Do this one of two ways: the automated script (recommended) or by hand in the Unity Editor:
有兩種方式可完成此步驟: 自動化指令碼(建議)或在 Unity 編輯器中手動操作:
有两种方式可完成此步骤: 自动化脚本(推荐)或在 Unity 编辑器中手动操作:
Run the bundled helper against your Unity game project. It resolves the editor from your project’s ProjectSettings/ProjectVersion.txt, materializes the SDK into Packages/com.vnggames.sdk, then copies in the demo assets:
對你的 Unity 遊戲專案執行隨附的輔助指令碼。它會從專案的 ProjectSettings/ProjectVersion.txt 解析編輯器版本,先將 SDK 放入 Packages/com.vnggames.sdk,再複製範例資源:
对你的 Unity 游戏工程运行随包附带的辅助脚本。它会从工程的 ProjectSettings/ProjectVersion.txt 解析编辑器版本,先将 SDK 放入 Packages/com.vnggames.sdk,再复制示例资源:
# run from the unzipped bundle folder
./add-vgsdk-package.sh \
--project /path/to/YourUnityGame \
--package ./VGSDK-Unity-<ver>.unitypackageImporting by hand into a project that already has SDK-dependent scripts can fail to compile on open. The automated script avoids this by materializing the SDK first, so prefer it when you can.
若專案已包含依賴 SDK 的指令碼,直接手動匯入可能在開啟時編譯失敗。自動化指令碼會先放置 SDK 以規避此問題,因此建議盡量優先使用。
若工程已包含依赖 SDK 的脚本,直接手动导入可能在打开时编译失败。自动化脚本会先放置 SDK 以规避此问题,因此建议尽量优先使用。
Export the native project
Set your bundle / application id in Player Settings (or pass --bundle-id) and close the Unity Editor first: Unity can’t open the same project twice. Each exporter drives Unity headlessly and writes its output to an Exported/ folder beside your project.
請先在 Player Settings 設定 bundle / application id(或傳入 --bundle-id),並關閉 Unity 編輯器: Unity 無法同時開啟同一專案。每個匯出器都以無介面方式驅動 Unity,並將輸出寫入專案旁的 Exported/ 目錄。
请先在 Player Settings 设置 bundle / application id(或传入 --bundle-id),并关闭 Unity 编辑器: Unity 无法同时打开同一工程。每个导出器都以无界面方式驱动 Unity,并将输出写入工程旁的 Exported/ 目录。
iOS: Xcode project. Edit export-xcode.config (SCENE, TARGET, BUNDLE_ID), then:
iOS: Xcode 專案。 編輯 export-xcode.config(SCENE、TARGET、BUNDLE_ID),然後:
iOS: Xcode 工程。 编辑 export-xcode.config(SCENE、TARGET、BUNDLE_ID),然后:
./export-xcode-project.sh # uses export-xcode.config
./export-xcode-project.sh --target device # device | simulator | bothAndroid: Gradle project. Edit export-android.config (SCENE, BUNDLE_ID), export, then configure the project for a current Android Studio (JDK 17 · AGP 8.5.1 · Gradle 8.9 · NDK 28+):
Android: Gradle 專案。 編輯 export-android.config(SCENE、BUNDLE_ID),匯出後再設定專案以符合最新的 Android Studio(JDK 17 · AGP 8.5.1 · Gradle 8.9 · NDK 28+):
Android: Gradle 工程。 编辑 export-android.config(SCENE、BUNDLE_ID),导出后再配置工程以符合最新的 Android Studio(JDK 17 · AGP 8.5.1 · Gradle 8.9 · NDK 28+):
./export-android-project.sh # uses export-android.config
./config-android-project.sh # configures Exported/Android/ for buildingInstall Android Build Support → Android SDK & NDK Tools + OpenJDK for your editor via Unity Hub. Building the exported project needs JDK 17 and NDK ≥ 28 (16 KB page support, required by Google Play). The config step auto-detects both and stops with exact instructions if either is missing.
請透過 Unity Hub 為你的編輯器安裝 Android Build Support → Android SDK 與 NDK Tools + OpenJDK。建置匯出的專案需要 JDK 17 與 NDK ≥ 28(16 KB 頁支援,Google Play 要求)。設定步驟會自動偵測兩者,缺失時以精確的安裝說明停止。
请通过 Unity Hub 为你的编辑器安装 Android Build Support → Android SDK 与 NDK Tools + OpenJDK。构建导出的工程需要 JDK 17 与 NDK ≥ 28(16 KB 页支持,Google Play 要求)。配置步骤会自动检测两者,缺失时以精确的安装说明停止。
Finish & verify
- iOS: open
Exported/Xcode-device/Unity-iPhone.xcodeproj, select your team & provisioning profile, enable the declared capabilities (Push, Sign in with Apple) for your App ID in the Apple Developer portal, then build & run (use theXcode-simulatorproject for the Simulator). - Android: open
Exported/Android/in Android Studio, let Gradle sync, then Run on a device/emulator or Build → Build APK / Bundle. Sign store builds with your own release keystore.
- iOS: 用 Xcode 開啟
Exported/Xcode-device/Unity-iPhone.xcodeproj,選擇你的團隊與 provisioning profile,在 Apple Developer 後台為你的 App ID 啟用已宣告的功能(推播、Sign in with Apple),然後建置並執行(模擬器請改用Xcode-simulator專案)。 - Android: 用 Android Studio 開啟
Exported/Android/,等待 Gradle 同步,然後在真機/模擬器上 Run 或 Build → Build APK / Bundle。正式發佈請使用你自己的發佈 keystore 簽署。
- iOS: 用 Xcode 打开
Exported/Xcode-device/Unity-iPhone.xcodeproj,选择你的团队与 provisioning profile,在 Apple Developer 后台为你的 App ID 启用已声明的能力(推送、Sign in with Apple),然后构建并运行(模拟器请改用Xcode-simulator工程)。 - Android: 用 Android Studio 打开
Exported/Android/,等待 Gradle 同步,然后在真机/模拟器上 Run 或 Build → Build APK / Bundle。正式发布请使用你自己的发布 keystore 签名。
Notes
- The export scripts run Unity in batch mode and generate a throwaway build script deleted on exit: they leave no files in your project.
- The SDK’s native wiring runs automatically during export: iOS plists / capabilities via the iOS post-process, Android Gradle files via
IPostGenerateGradleAndroidProject. - Re-running is safe: each export wipes and recreates its own output folder (
Exported/Xcode-*orExported/Android), and importing the SDK is idempotent. - iOS Simulator: Unity stamps the device SDK onto the project. The exporter auto-normalizes the Simulator project back to
iphonesimulatorso it builds. - Keep the helper scripts, the
.unitypackage, andVNGGamesSDKDemo/together at the bundle root: the scripts auto-detect the project and package as siblings.
- 匯出指令碼以批次模式執行 Unity,並產生一個一次性的建置指令碼,退出時刪除: 不會在你專案裡留下檔案。
- SDK 的原生接線會在匯出時自動完成:iOS 的 plist/功能由 iOS 後處理完成,Android 的 Gradle 檔案由
IPostGenerateGradleAndroidProject完成。 - 可安全重複執行: 每次匯出都會清空並重建自己的輸出目錄(
Exported/Xcode-*或Exported/Android),且匯入 SDK 是幂等的。 - iOS 模擬器:Unity 會寫入真機 SDK。匯出器會自動修正模擬器專案回
iphonesimulator以便建置。 - 請將輔助指令碼、
.unitypackage與VNGGamesSDKDemo/一起放在發佈包根目錄: 指令碼會將專案與套件作為同級目錄自動偵測。
- 导出脚本以批处理模式运行 Unity,并生成一个一次性的构建脚本,退出时删除: 不会在你工程里留下文件。
- SDK 的原生接线会在导出时自动完成:iOS 的 plist/能力由 iOS 后处理完成,Android 的 Gradle 文件由
IPostGenerateGradleAndroidProject完成。 - 可安全重复运行: 每次导出都会清空并重建自己的输出目录(
Exported/Xcode-*或Exported/Android),且导入 SDK 是幂等的。 - iOS 模拟器:Unity 会写入真机 SDK。导出器会自动修正模拟器工程回
iphonesimulator以便构建。 - 请将辅助脚本、
.unitypackage与VNGGamesSDKDemo/一起放在分发包根目录: 脚本会将工程与包作为同级目录自动检测。
Troubleshooting
Android export: “requires JDK 17” / “Failed to update Android SDK package list”
Unity’s JDK doesn’t match the Android command-line tools. Set Preferences → External Tools → Android to “installed with Unity”.
Android export: “Android NDK not found”
The editor’s Android SDK & NDK Tools module isn’t installed. In Unity Hub: Add Modules → Android Build Support → Android SDK & NDK Tools (+ OpenJDK), then re-export.
Config: “NDK 28+ not found”
Install it (sdkmanager "ndk;28.2.13676358" or Android Studio → SDK Manager → NDK), or set NDK_PATH in config-android.config, then re-run ./config-android-project.sh.
APK is 32-bit only / arm64 mismatch (CXX5202)
An old Mono build. Re-run ./export-android-project.sh (IL2CPP builds arm64-v8a,armeabi-v7a by default), then re-run the config step.
Gradle errors (repositoriesMode, static STL CXX1212, ndkPath + ndk.dir CXX1100)
The freshly-exported project isn’t configured yet. Run ./config-android-project.sh on it (and after any re-export).
Export aborts with exit code 134
Unity can’t open the same project twice. Close the Editor (or any running export) for that project, then re-run.
”No scene named …” / “Ambiguous scene name”
Pass a full asset path, e.g. --scene Assets/Scenes/SampleScene.unity.
”Unity editor binary not found”
Install the version from ProjectVersion.txt via Unity Hub, or pass --unity /path/to/Unity (or set UNITY_PATH).
Firebase / push / analytics don’t initialize
Add GoogleService-Info.plist (iOS) / google-services.json (Android) for your exact bundle id, then export again.
iOS build: Swift package resolve fails (stale cache / checksum mismatch)
SwiftPM’s global cache is holding a stale artifact. Quit Xcode, then run rm -rf ~/Library/Caches/org.swift.swiftpm and reopen the exported Unity-iPhone.xcodeproj to resolve again.
Push / Sign in with Apple don’t work at runtime (iOS)
Enable them for your App ID in the Apple Developer portal and use a matching provisioning profile.
Editor won’t compile right after importing the SDK
Use add-vgsdk-package.sh. It materializes the SDK before the demo scripts so the compile order stays valid.
Android 匯出:「requires JDK 17」/「Failed to update Android SDK package list」
Unity 使用的 JDK 與 Android 命令列工具不相符。將 Preferences → External Tools → Android 設為「installed with Unity」。
Android 匯出:「Android NDK not found」
編輯器未安裝 Android SDK 與 NDK Tools 模組。在 Unity Hub:Add Modules → Android Build Support → Android SDK 與 NDK Tools(以及 OpenJDK),然後重新匯出。
設定:「NDK 28+ not found」
安裝它(sdkmanager "ndk;28.2.13676358" 或 Android Studio → SDK Manager → NDK),或在 config-android.config 設定 NDK_PATH,然後重新執行 ./config-android-project.sh。
APK 僅 32 位元/arm64 不符(CXX5202)
舊的 Mono 建置。重新執行 ./export-android-project.sh(IL2CPP 預設建置 arm64-v8a,armeabi-v7a),然後重新執行設定步驟。
Gradle 錯誤(repositoriesMode、靜態 STL CXX1212、ndkPath + ndk.dir CXX1100)
剛匯出的專案尚未設定。對它執行 ./config-android-project.sh(每次重新匯出後也要執行)。
匯出以退出碼 134 中止
Unity 無法同時開啟同一專案。關閉該專案的編輯器(或其他正在執行的匯出),然後重新執行。
「No scene named …」/「Ambiguous scene name」
傳入完整資源路徑,例如 --scene Assets/Scenes/SampleScene.unity。
「Unity editor binary not found」
透過 Unity Hub 安裝 ProjectVersion.txt 中的版本,或傳入 --unity /path/to/Unity(或設定 UNITY_PATH)。
Firebase/推播/分析無法初始化
為你的確切 bundle id 加入 GoogleService-Info.plist(iOS)/ google-services.json(Android),然後重新匯出。
iOS 建置:Swift 套件解析失敗(快取過時/checksum 不符)
SwiftPM 的全域快取仍保有過時的成品。請結束 Xcode,然後執行 rm -rf ~/Library/Caches/org.swift.swiftpm,再重新開啟匯出的 Unity-iPhone.xcodeproj 重新解析。
推播/Sign in with Apple 執行時不工作(iOS)
在 Apple Developer 後台為你的 App ID 啟用它們,並使用相符的 provisioning profile。
匯入 SDK 後編輯器無法編譯
使用 add-vgsdk-package.sh。它會先放置 SDK 再複製範例指令碼,因此編譯順序始終有效。
Android 导出:“requires JDK 17” / “Failed to update Android SDK package list”
Unity 使用的 JDK 与 Android 命令行工具不匹配。将 Preferences → External Tools → Android 设为“installed with Unity”。
Android 导出:“Android NDK not found”
编辑器未安装 Android SDK 与 NDK Tools 模块。在 Unity Hub:Add Modules → Android Build Support → Android SDK 与 NDK Tools(以及 OpenJDK),然后重新导出。
配置:“NDK 28+ not found”
安装它(sdkmanager "ndk;28.2.13676358" 或 Android Studio → SDK Manager → NDK),或在 config-android.config 设置 NDK_PATH,然后重新运行 ./config-android-project.sh。
APK 仅 32 位/arm64 不匹配(CXX5202)
旧的 Mono 构建。重新运行 ./export-android-project.sh(IL2CPP 默认构建 arm64-v8a,armeabi-v7a),然后重新运行配置步骤。
Gradle 错误(repositoriesMode、静态 STL CXX1212、ndkPath + ndk.dir CXX1100)
刚导出的工程尚未配置。对它运行 ./config-android-project.sh(每次重新导出后也要运行)。
导出以退出码 134 中止
Unity 无法同时打开同一工程。关闭该工程的编辑器(或其他正在运行的导出),然后重新运行。
“No scene named …” / “Ambiguous scene name”
传入完整资源路径,例如 --scene Assets/Scenes/SampleScene.unity。
“Unity editor binary not found”
通过 Unity Hub 安装 ProjectVersion.txt 中的版本,或传入 --unity /path/to/Unity(或设置 UNITY_PATH)。
Firebase/推送/统计无法初始化
为你的确切 bundle id 添加 GoogleService-Info.plist(iOS)/ google-services.json(Android),然后重新导出。
iOS 构建:Swift 包解析失败(缓存过时/checksum 不匹配)
SwiftPM 的全局缓存仍保有过时的成品。请结束 Xcode,然后运行 rm -rf ~/Library/Caches/org.swift.swiftpm,再重新打开导出的 Unity-iPhone.xcodeproj 重新解析。
推送/Sign in with Apple 运行时不工作(iOS)
在 Apple Developer 后台为你的 App ID 启用它们,并使用匹配的 provisioning profile。
导入 SDK 后编辑器无法编译
使用 add-vgsdk-package.sh。它会先放置 SDK 再复制示例脚本,因此编译顺序始终有效。
Authentication
Sign the player in through the SDK’s channel picker or a specific channel, and delete the signed-in account. Every login callback delivers the signed-in player’s info on success, or an error on cancel/failure. Zero-interaction quick login and VGA account management live in the Quick Authentication section.
透過 SDK 的頻道選擇器或指定頻道讓玩家登入,並可刪除已登入的帳號。每次登入回呼在成功時會傳回已登入玩家的資訊,在取消或失敗時則傳回錯誤。零互動的快速登入與 VGA 帳號管理位於 Quick Authentication 區段。
通过 SDK 的渠道选择器或指定渠道让玩家登录,并可删除已登录的账号。每次登录回调在成功时会返回已登录玩家的信息,在取消或失败时则返回错误。零交互的快速登录与 VGA 账号管理位于 Quick Authentication 部分。
Show the login form
AndroidiOSPresents the login form so the player can pick a sign-in channel.
顯示登入表單,讓玩家選擇登入頻道。
显示登录表单,让玩家选择登录渠道。
PassSDK.Instance.ShowFormLogin(result =>
{
result.Match(
user => { /* Signed in: user.UserId, user.DisplayName, user.SessionId */ },
error => { /* Handle cancel/failure: error.Code, error.Message */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。 |
Auto login
AndroidiOSSilently re-authenticates the last-used channel if a session exists, otherwise presents the login form.
若已存在工作階段,會以最近使用的頻道靜默重新驗證。否則顯示登入表單。
若已存在会话,会以最近使用的渠道静默重新验证。否则显示登录表单。
PassSDK.Instance.AutoLogin(result =>
{
result.Match(
user => { /* Same result as ShowFormLogin */ },
error => { /* Handle failure */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。 |
Direct login to a channel
AndroidiOSSigns in to one channel directly, bypassing the picker.
直接登入單一頻道,略過選擇器。
直接登录单一渠道,跳过选择器。
PassSDK.Instance.DirectLogin(LoginChannel.Google, result =>
{
result.Match(
user => { /* signed in */ },
error => { /* handle failure */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
channel | LoginChannel | Channel to sign in to: see LoginChannel. |
| 欄位 | 型別 | 說明 |
|---|---|---|
channel | LoginChannel | 要登入的頻道: 請參閱 LoginChannel。 |
| 字段 | 类型 | 描述 |
|---|---|---|
channel | LoginChannel | 要登录的渠道: 请参阅 LoginChannel。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。 |
Log out
AndroidiOSSigns the current player out and clears the stored session.
將目前的玩家登出並清除已儲存的工作階段。
将当前玩家登出并清除已保存的会话。
PassSDK.Instance.Logout();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Check the login session (server-side only)
Validates a player’s session from YOUR game server, not from the client. After a login callback hands the game a userID and a sessionID, the game’s backend POSTs them to /api/login/checkSession as application/x-www-form-urlencoded, and trusts the player only when returnCode is 1. There is no SDK call for this and no client-side equivalent: a client can claim any session, which is the reason the check exists. The domain to send it to and your game’s secret key are issued on request, see below.
從你的遊戲伺服器驗證玩家的工作階段,而不是從用戶端。登入回呼把 userID 與 sessionID 交給遊戲之後,遊戲的後端以 application/x-www-form-urlencoded 將兩者 POST 到 /api/login/checkSession,只有在 returnCode 為 1 時才信任該玩家。SDK 沒有對應的呼叫,用戶端也沒有等價做法:用戶端可以宣稱任何工作階段,這正是需要這道檢查的原因。要送往的網域與你的遊戲 secret key 需另行申請,見下方說明。
从你的游戏服务器验证玩家的会话,而不是从客户端。登录回调把 userID 与 sessionID 交给游戏之后,游戏的后端以 application/x-www-form-urlencoded 将两者 POST 到 /api/login/checkSession,只有在 returnCode 为 1 时才信任该玩家。SDK 没有对应的调用,客户端也没有等价做法:客户端可以声称任何会话,这正是需要这道检查的原因。要发往的域名与你的游戏 secret key 需另行申请,见下方说明。
# Domain and secret key come from your server's environment, never from a literal.
TIMESTAMP=$(date +%s)
SIG=$(printf '%s%s%s%s%s' "$VGA_SECRET_KEY" "$GAME_ID" "$USER_ID" "$TIMESTAMP" "$SESSION_ID" | md5sum | cut -d' ' -f1)
curl -X POST "$VGA_DOMAIN/api/login/checkSession" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "gameID=$GAME_ID" \
--data-urlencode "userID=$USER_ID" \
--data-urlencode "sessionID=$SESSION_ID" \
--data-urlencode "timestamp=$TIMESTAMP" \
--data-urlencode "sig=$SIG"Server-side only. The path is
/api/login/checkSession, but the DOMAIN and your game’s secret key are not published here. Email pin.sdk.dev@vng.com.vn to be issued both. The secret key must never ship in a game client.
僅限伺服器端。 路徑為
/api/login/checkSession,但網域與你的遊戲 secret key 不會公開在這裡,請來信 pin.sdk.dev@vng.com.vn 索取。secret key 絕對不可以隨遊戲用戶端一起發布。
仅限服务器端。 路径为
/api/login/checkSession,但域名与你的游戏 secret key 不会公开在这里,请来信 pin.sdk.dev@vng.com.vn 索取。secret key 绝对不可以随游戏客户端一起发布。
Input
輸入
输入
| Field | Type | Description |
|---|---|---|
userID | string | Unique VNGGames user id. |
sessionID | string | Session token used to authenticate backend calls. |
gameID | string | A VNGGames Account credential the SDK reads. |
timestamp | string | Unix time in SECONDS at the moment of the call. |
sig | string | Checksum over the other parameters: md5(secretKey + gameID + userID + timestamp + sessionID). The secret key is issued to your team and lives server-side only, which is what keeps this call off the client. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | string | VNGGames 唯一使用者 ID。 |
sessionID | string | 用於驗證後端呼叫的工作階段權杖。 |
gameID | string | SDK 會讀取的 VNGGames Account 憑證。 |
timestamp | string | 發出呼叫當下的 Unix 時間,單位為「秒」。 |
sig | string | 其餘參數的檢查碼:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 團隊發給你的團隊,且只存在於伺服器端,這正是這個呼叫不能放在用戶端的原因。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | string | VNGGames 唯一用户 ID。 |
sessionID | string | 用于验证后端调用的会话令牌。 |
gameID | string | SDK 会读取的 VNGGames Account 凭据。 |
timestamp | string | 发出调用当下的 Unix 时间,单位为「秒」。 |
sig | string | 其余参数的校验和:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 团队发给你的团队,且只存在于服务器端,这正是这个调用不能放在客户端的原因。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
returnCode | int | Treat anything other than 1 as not signed in.• 1 the session is valid.• -1 bad sig.• -2 bad parameter.• -108 the session does not exist.• -404 unknown endpoint.• -500 service error. |
message | string | Human-readable result, for your server logs rather than for players. |
data | null | Always null on this endpoint. The verdict is returnCode. |
| 欄位 | 型別 | 說明 |
|---|---|---|
returnCode | int | 只要不是 1,一律視為未登入。• 1 工作階段有效。• -1 sig 有誤。• -2 參數有誤。• -108 工作階段不存在。• -404 端點不存在。• -500 服務錯誤。 |
message | string | 可讀的結果訊息,用於你的伺服器紀錄,而不是顯示給玩家。 |
data | null | 這個端點永遠回傳 null,判定結果看 returnCode。 |
| 字段 | 类型 | 描述 |
|---|---|---|
returnCode | int | 只要不是 1,一律视为未登录。• 1 会话有效。• -1 sig 有误。• -2 参数有误。• -108 会话不存在。• -404 端点不存在。• -500 服务错误。 |
message | string | 可读的结果消息,用于你的服务器日志,而不是显示给玩家。 |
data | null | 这个端点永远返回 null,判定结果看 returnCode。 |
Is delete-account enabled
iOSReports whether the current account supports self-service deletion, so the game can show/hide the entry point.
回報目前帳號是否支援自助刪除,讓遊戲可據此顯示或隱藏入口。
报告当前账号是否支持自助删除,以便游戏据此显示或隐藏入口。
Account deletion applies to Direct login accounts only.
帳號刪除僅適用於 Direct login 帳號。
账号删除仅适用于 Direct login 账号。
PassSDK.Instance.DeleteAccountEnabled(result =>
{
result.Match(
enabled => { /* "true"/"false": whether delete-account is available */ },
error => { /* error.Code == 404 when unsupported on this platform */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | ”true”/“false”: whether delete-account is available. |
error | Error | Present on failure: 404 when the feature is unsupported on this platform. See General error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | ”true”/“false”: 刪除帳號是否可用。 |
error | Error | 失敗時存在: 當該功能在目前原生平台不受支援時為 404。請參閱 一般錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | ”true”/“false”: 删除账号是否可用。 |
error | Error | 失败时存在: 当该功能在当前原生平台不受支持时为 404。请参阅 通用错误码。 |
Delete account
iOSRuns the account-deletion flow.
執行帳號刪除流程。
执行账号删除流程。
Account deletion applies to Direct login accounts only.
帳號刪除僅適用於 Direct login 帳號。
账号删除仅适用于 Direct login 账号。
PassSDK.Instance.DeleteAccount(result =>
{
result.Match(
ok => { /* account deletion flow completed */ },
error => { /* error.Code == 404 when unsupported on this platform */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Delete-account flow result. |
error | Error | Present on failure: 404 when the feature is unsupported on this platform. See General error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 刪除帳號流程的結果。 |
error | Error | 失敗時存在: 當該功能在目前原生平台不受支援時為 404。請參閱 一般錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 删除账号流程的结果。 |
error | Error | 失败时存在: 当该功能在当前原生平台不受支持时为 404。请参阅 通用错误码。 |
Quick Authentication
Zero-interaction sign-in and VGA account management: available only with VGA login. v1 (PassSDK.shared) is the first-generation API: quick login resolves on the login callback. v2 (VGSDKQuickAuth) is the listener-based facade: the listener’s onSuccess delivers the player’s info, onError the failure reason. Manage account opens the VGA account-management screen and applies to accounts signed in with either version.
零互動登入與 VGA 帳號管理: 僅在使用 VGA 登入時可用。v1(PassSDK.shared)為第一代 API:快速登入透過登入回呼回傳結果。v2(VGSDKQuickAuth)為以監聽器為基礎的門面:監聽器的 onSuccess 會傳回玩家資訊,onError 則傳回失敗原因。管理帳號 會開啟 VGA 帳號管理畫面,且適用於以任一版本登入的帳號。
零交互登录与 VGA 账号管理: 仅在 VGA 登录时可用。v1(PassSDK.shared)为第一代 API:快速登录在登录回调上返回结果。v2(VGSDKQuickAuth)为基于监听器的门面:监听器的 onSuccess 返回玩家信息,onError 返回失败原因。管理账号 会打开 VGA 账号管理界面,且适用于以任一版本登录的账号。
v1
Quick login
AndroidiOSSigns the player in with no form to load and no required interaction.
讓玩家登入,無需載入表單,也不需要任何互動。
无需加载表单、无需任何交互即可让玩家登录。
PassSDK.Instance.QuickLogin(result =>
{
result.Match(
user => { /* signed in */ },
error => { /* error on failure */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码。 |
v2
Sign in
AndroidiOSPresents the quick-authentication sign-in UI so the player signs in with an available account.
顯示快速身分驗證登入介面,讓玩家使用可用的帳號登入。
展示快速身份验证登录界面,让玩家使用可用账号登录。
VGSDKQuickAuth.ShowLogin(result =>
{
result.Match(
user => { /* signed in */ },
error => { /* failed */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码。 |
Play as guest
AndroidiOSSigns the player in as an anonymous guest: no account selection or credentials required.
以匿名訪客身分讓玩家登入: 無需選擇帳號或提供憑證。
以匿名访客身份让玩家登录: 无需选择账号或提供凭据。
VGSDKQuickAuth.PlayAsGuest(result =>
{
result.Match(
user => { /* signed in as guest */ },
error => { /* failed */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码。 |
Show channel selection
AndroidiOSPresents the channel picker so the player chooses which sign-in channel to use.
顯示頻道選擇器,讓玩家選擇要使用的登入頻道。
展示渠道选择器,让玩家选择要使用的登录渠道。
VGSDKQuickAuth.ShowChannelSelection(result =>
{
result.Match(
user => { /* signed in */ },
error => { /* failed */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | The failure reason when the player cancels or login fails: see VGA login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码。 |
Manage account
Open account management
AndroidiOSOpens the VGA account-management screen and reports what the player did. Works for accounts signed in with either quick-auth version.
開啟 VGA 帳號管理畫面,並回報玩家執行的操作。
打开 VGA 账号管理界面并报告玩家所执行的操作。
PassSDK.Instance.ManageAccount(result =>
{
result.Match(
manage => { /* manage.Action (AccountBound/AccountSwitched/...), manage.UserInfo */ },
error => { /* handle failure */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value.Action | VGSDKManageAccountAction | The action the player took. See VGSDKManageAccountAction. |
value.UserInfo | PassUserInfo | The signed-in player. Fields: PassUserInfo. |
error | Error | Present on cancel/failure: see VGA login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value.Action | VGSDKManageAccountAction | 玩家執行的操作。請參閱 VGSDKManageAccountAction。 |
value.UserInfo | PassUserInfo | 已登入的玩家。欄位詳見 PassUserInfo。 |
error | Error | 取消/失敗時存在: 請參閱 VGA 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value.Action | VGSDKManageAccountAction | 玩家执行的操作。请参阅 VGSDKManageAccountAction。 |
value.UserInfo | PassUserInfo | 已登录的玩家。字段详见 PassUserInfo。 |
error | Error | 取消/失败时存在: 请参阅 VGA 登录错误码。 |
In-App Purchase
Query the sellable products, then run a purchase through Google Play Billing / App Store In-App Purchase. Products and purchase status are delivered on listener closures.
查詢可販售的商品,然後透過 Google Play Billing/App Store In-App Purchase 執行購買。商品與購買狀態會透過監聽器閉包傳回。
先查询可售商品,然后通过 Google Play Billing / App Store In-App Purchase 执行购买。商品与购买状态在监听器闭包上返回。
Get products
AndroidiOSFetches the sellable products for a set of item ids.
為一組道具 ID 取得可販售的商品。
为一组物品 id 获取可售商品。
VGSDKPayment.GetProducts(new[] { "com.game.pack1", "com.game.pack2" }, result =>
{
result.Match(
products => { foreach (var p in products.Products) { /* p.ItemId, p.DisplayPrice */ } },
error => { /* handle failure */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
ids | string[] | List of configured item id from Store. |
| 欄位 | 型別 | 說明 |
|---|---|---|
ids | string[] | 在商店設定的商品 id 清單。 |
| 字段 | 类型 | 描述 |
|---|---|---|
ids | string[] | 在商店配置的商品 id 列表。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | VGSDKPaymentProducts | The products found. Empty when no id matched. Products: VGSDKPaymentProduct[]. |
error | Error | Present on failure: see billing / store payment error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | VGSDKPaymentProducts | 找到的商品。沒有 id 相符時為空。Products:VGSDKPaymentProduct[]。 |
error | Error | 失敗時存在: 請參閱 帳務/商店 付款錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | VGSDKPaymentProducts | 找到的商品。没有 id 匹配时为空。Products:VGSDKPaymentProduct[]。 |
error | Error | 失败时存在: 请参阅 计费 / 商店 支付错误码。 |
Purchase
AndroidiOSRuns a purchase and reports the outcome. Build the request with the purchase-info object: all fields required.
執行購買並回報結果。使用購買資訊物件建立請求: 所有欄位皆為必填。
执行购买并报告结果。使用购买信息对象构建请求: 所有字段均为必填。
var info = new Dictionary<string, string>
{
{ "userId", userId },
{ "serverId", serverId },
{ "roleId", roleId },
{ "itemId", "com.game.pack1" },
{ "appTransId", appTransId },
};
VGSDKPayment.Purchase(info, result =>
{
result.Match(
receipt => { /* purchase completed */ },
error => { /* error.Code 9009 = user canceled, 9014 = pay failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
info | Dictionary<string, string> | The purchase request: keys userId, serverId, roleId, itemId, appTransId (and optional passthrough). |
| 欄位 | 型別 | 說明 |
|---|---|---|
info | Dictionary<string, string> | 購買請求: 鍵 userId、serverId、roleId、itemId、appTransId(以及可選的傳遞資料)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
info | Dictionary<string, string> | 购买请求: 键 userId、serverId、roleId、itemId、appTransId(以及可选的透传数据)。 |
Output
輸出
输出
Check item reward
AndroidReports whether the player has a reward waiting to be granted, so the game can show or hide the claim entry point.
回報玩家是否有待發放的獎勵,讓遊戲決定要顯示或隱藏領取入口。
报告玩家是否有待发放的奖励,让游戏决定要显示或隐藏领取入口。
Run this before Verify reward: it only reports availability and grants nothing by itself.
請先執行此檢查,再呼叫「驗證獎勵」。它只回報是否有獎勵,本身不會發放任何內容。
请先执行此检查,再调用“验证奖励”。它只报告是否有奖励,本身不会发放任何内容。
VGSDKPayment.CheckReward(result =>
{
result.Match(
status => { /* "available": a reward is pending. "unavailable": none */ },
error => { /* error.Code 9007: the check failed */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | "available" when a reward is pending, "unavailable" when there is none. |
error | Error | Present on failure: Code 9007 (IAP_FAILED), message Failed to check reward. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 有待發放的獎勵時為 "available",沒有時為 "unavailable"。 |
error | Error | 失敗時提供:Code 為 9007(IAP_FAILED),訊息為 Failed to check reward。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 有待发放的奖励时为 "available",没有时为 "unavailable"。 |
error | Error | 失败时提供:Code 为 9007(IAP_FAILED),消息为 Failed to check reward。 |
Verify reward
AndroidGrants the pending reward and reports whether a failure is worth retrying.
發放待領取的獎勵,並回報該次失敗是否值得重試。
发放待领取的奖励,并报告该次失败是否值得重试。
Call this only after Check item reward reports a pending reward.
請僅在「檢查道具獎勵」回報有待發放的獎勵之後才呼叫。
请仅在“检查道具奖励”报告有待发放的奖励之后才调用。
var info = new Dictionary<string, string>
{
{ "userId", userId },
{ "appTransId", appTransId },
{ "roleId", roleId },
{ "serverId", serverId },
{ "addInfo", "" },
};
VGSDKPayment.VerifyReward(info, result =>
{
result.Match(
status => { /* "success": the reward was granted */ },
error => { /* error.Code 9007: retry. 9000: do not retry */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
info | Dictionary<string, string> | The reward claim: keys userId, appTransId, roleId, serverId, addInfo. All five are required, a missing key throws instead of defaulting. |
info.userId | string | Buyer’s VNGGames user id. |
info.appTransId | string | Your app-side transaction id, for reconciliation. |
info.roleId | string | Character/role id. |
info.serverId | string | Game server id. |
info.addInfo | string | Extra passthrough data. Empty string when unused. |
| 欄位 | 型別 | 說明 |
|---|---|---|
info | Dictionary<string, string> | 獎勵領取請求:鍵為 userId、appTransId、roleId、serverId、addInfo。五個皆為必填,缺少任一個會直接拋出例外而非使用預設值。 |
info.userId | string | Buyer’s VNGGames user id. |
info.appTransId | string | Your app-side transaction id, for reconciliation. |
info.roleId | string | Character/role id. |
info.serverId | string | Game server id. |
info.addInfo | string | Extra passthrough data. Empty string when unused. |
| 字段 | 类型 | 描述 |
|---|---|---|
info | Dictionary<string, string> | 奖励领取请求:键为 userId、appTransId、roleId、serverId、addInfo。五个均为必填,缺少任一个会直接抛出异常而非使用默认值。 |
info.userId | string | Buyer’s VNGGames user id. |
info.appTransId | string | Your app-side transaction id, for reconciliation. |
info.roleId | string | Character/role id. |
info.serverId | string | Game server id. |
info.addInfo | string | Extra passthrough data. Empty string when unused. |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | "success" when the reward was granted. |
error | Error | Present on failure: Code 9007 marks a transient failure that is safe to retry. Code 9000 marks a permanent one, do not retry the same request. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 獎勵發放成功時為 "success"。 |
error | Error | 失敗時提供:Code 為 9007 表示暫時性失敗,可安全重試。Code 為 9000 表示永久失敗,請勿以相同請求重試。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 奖励发放成功时为 "success"。 |
error | Error | 失败时提供:Code 为 9007 表示临时性失败,可安全重试。Code 为 9000 表示永久失败,请勿以相同请求重试。 |
Analytics
One facade for every analytics provider, organised by use case. Configure analytics first, then send ad-hoc custom events or the structured use-case funnels (Conversion Rate = app launch → play, Onboarding = new user → early monetization, Main & Daily Activities, Social & Communities). Providers: AppsFlyer, Firebase, Data Platform, Facebook, CleverTap, ThinkingData. Every call is fire-and-forget. Every event also carries a set of default parameters the SDK fills in automatically: see Analytics default parameters.
Notice: Every event the VNGGames SDK APIs trigger starts with the
vgsdk_prefix and follows the formulavgsdk_{prefix}_{event name}: for example,vgsdk_af_app_open. See Analytics platform prefixes.
涵蓋所有分析供應商的單一門面,依使用情境組織。請先設定分析,然後傳送臨時的自訂事件,或使用結構化的使用情境漏斗(Conversion Rate=應用程式啟動 → 遊玩、Onboarding=新使用者 → 早期營利、Main & Daily Activities、Social & Communities)。供應商:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每個呼叫都是 fire-and-forget。每個事件還會帶有一組由 SDK 自動填入的預設參數: 請參閱 分析預設參數。
注意: VNGGames SDK API 觸發的每個事件都以
vgsdk_前綴開頭,並遵循vgsdk_{prefix}_{event name}公式: 例如vgsdk_af_app_open。請參閱 分析平台前綴。
面向所有分析提供方的统一门面,按使用场景组织。先配置分析,然后发送临时自定义事件或结构化的使用场景漏斗(Conversion Rate = 应用启动 → 游玩,Onboarding = 新用户 → 早期变现,Main & Daily Activities,Social & Communities)。提供方:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每次调用都是 fire-and-forget。每个事件还会携带一组由 SDK 自动填充的默认参数: 请参阅 分析默认参数。
注意: VNGGames SDK API 触发的每个事件都以
vgsdk_前缀开头,并遵循公式vgsdk_{prefix}_{event name}: 例如vgsdk_af_app_open。请参阅 分析平台前缀。
Setup
Configure analytics
AndroidiOSRequired analytics setup: binds the current role id and name to the analytics session so tracked events carry role context. Call once after login, before sending events.
必要的分析設定:將目前的角色 ID 與名稱綁定到分析工作階段,讓追蹤的事件帶有角色情境。請在登入後、傳送事件前呼叫一次。
必需的分析设置:将当前角色 id 和名称绑定到分析会话,使追踪的事件带有角色上下文。登录后、发送事件前调用一次。
Required setup for analytics.
分析的必要設定。
分析的必需设置。
// Bind role context once after login, before sending events
VGSDKAnalytics.MiscConfigAnalytics("role-1", "Hero");Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
roleName | string | Character/role name. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
roleName | string | 角色名稱。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
roleName | string | 角色名称。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Integration Limitations
Rules & limits
Constraints that apply to every event you send through this facade: they aggregate the rules of the underlying providers. Review them before instrumenting:
- Event names must begin with a letter, contain no spaces (use underscores), and be at most 100 characters. They may not begin with
",\,=,+, or-, are case-sensitive (af_purchase≠af_PURCHASE), and may include non-English characters. - Per event: at most 25 parameters.
- Parameter names must be at most 40 characters.
- Parameter values must not exceed 1000 characters (longer values may be truncated). Keep total event values under 2000 characters.
- Revenue / price values use digits and a single decimal point only, with at most 5 digits after the point.
- Cardinality: at most 300 unique event names per day.
- Unique users are counted only for the first 100 events after a user installs the app.
- Referring URLs must be URL-encoded.
- Meta (Facebook) Ads impose additional limits on event parameters.
適用於你透過此門面傳送的每個事件的限制: 它們彙整了底層各供應商的規則。請在埋點前詳閱:
- 事件名稱 必須以字母開頭、不得包含空格(請使用底線),且最多 100 個字元。不得以
"、\、=、+或-開頭,區分大小寫(af_purchase≠af_PURCHASE),並可包含非英文字元。 - 每個事件: 最多 25 個參數。
- 參數名稱 最多 40 個字元。
- 參數值 不得超過 1000 個字元(過長的值可能會被截斷)。請將事件的總值控制在 2000 個字元以內。
- 收益/價格值 僅能使用數字與單一小數點,小數點後最多 5 位數。
- 基數: 每天最多 300 個不重複的事件名稱。
- 不重複使用者 僅在使用者安裝應用程式後的前 100 個事件內計算。
- 來源 URL 必須經過 URL 編碼。
- Meta(Facebook)Ads 對事件參數施加額外限制。
适用于你通过此门面发送的每个事件的约束: 它们汇总了底层各提供方的规则。在埋点前请先阅读:
- 事件名称 必须以字母开头,不含空格(使用下划线),且最多 100 个字符。不得以
"、\、=、+或-开头,区分大小写(af_purchase≠af_PURCHASE),并且可以包含非英文字符。 - 每个事件: 最多 25 个参数。
- 参数名称 最多 40 个字符。
- 参数值 不得超过 1000 个字符(过长的值可能被截断)。请将事件的总值保持在 2000 个字符以内。
- 收入 / 价格值 只能使用数字和单个小数点,小数点后最多 5 位。
- 基数(Cardinality): 每天最多 300 个唯一事件名称。
- 唯一用户 仅统计用户安装应用后的前 100 个事件。
- 引荐 URL(Referring URLs) 必须经过 URL 编码。
- Meta(Facebook)广告 对事件参数施加额外限制。
Custom event
Send a custom event
AndroidiOSSends one custom event to the providers you explicitly choose via the platforms list. The event name is sent as-is: its natural name: apart from the optional per-provider prefix you set yourself. To send to the SDK’s default provider set without naming platforms, use miscCustomEvent instead.
將一個自訂事件傳送到你透過 platforms 清單明確選擇的供應商。事件名稱會原樣傳送: 使用其自然名稱: 除了你自行設定的可選每供應商前綴之外。若要在不指定平台的情況下傳送到 SDK 的預設供應商集合,請改用 miscCustomEvent。
向你通过 platforms 列表显式选择的提供方发送一个自定义事件。事件名称按原样(其自然名称)发送,仅带上你自行设置的可选的每提供方前缀。若要发送到 SDK 的默认提供方集合而不指定 platforms,请改用 miscCustomEvent。
// Pick the providers to send to (constructor: provider, prefix; "" = no per-provider prefix)
var facebook = new VGSDKAnalyticsPlatform(VGSDKAnalyticsProvider.Facebook, "");
VGSDKAnalytics.SendCustomEvent(
"level_up",
new Dictionary<string, string> { { "level", "5" } },
new List<VGSDKAnalyticsPlatform> { facebook });Input
輸入
输入
| Field | Type | Description |
|---|---|---|
eventName | string | Event name. |
parameters | Dictionary<string, string> | Event parameters. |
platforms | List<VGSDKAnalyticsPlatform> | Target providers. Each entry selects a provider + event-name prefix. |
platforms[].Provider | VGSDKAnalyticsProvider | Provider to send to: see VGSDKAnalyticsProvider. |
platforms[].Prefix | string | Prefix prepended to the event name for that provider. |
| 欄位 | 型別 | 說明 |
|---|---|---|
eventName | string | 事件名稱。 |
parameters | Dictionary<string, string> | 事件參數。 |
platforms | List<VGSDKAnalyticsPlatform> | 目標供應商。每個項目會選擇一個供應商+事件名稱前綴。 |
platforms[].Provider | VGSDKAnalyticsProvider | 要傳送到的供應商: 請參閱 VGSDKAnalyticsProvider。 |
platforms[].Prefix | string | 為該供應商加在事件名稱前的前綴。 |
| 字段 | 类型 | 描述 |
|---|---|---|
eventName | string | 事件名称。 |
parameters | Dictionary<string, string> | 事件参数。 |
platforms | List<VGSDKAnalyticsPlatform> | 目标提供方。每个条目选择一个提供方 + 事件名称前缀。 |
platforms[].Provider | VGSDKAnalyticsProvider | 要发送到的提供方: 请参阅 VGSDKAnalyticsProvider。 |
platforms[].Prefix | string | 为该提供方在事件名称前添加的前缀。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Misc: custom event
AndroidiOSSends a custom event to the SDK’s default provider set: the no-platform-list counterpart of sendCustomEvent (you don’t pick providers). The SDK auto-prefixes the event name per provider, delivering it as vgsdk_{prefix}_{event name}: see Analytics platform prefixes.
將自訂事件傳送到 SDK 的預設供應商集合: 為 sendCustomEvent 不帶平台清單的對應版本(你不需選擇供應商)。SDK 會依各供應商自動為事件名稱加上前綴,以 vgsdk_{prefix}_{event name} 傳遞: 請參閱 分析平台前綴。
向 SDK 的默认提供方集合发送一个自定义事件: 即 sendCustomEvent 的无 platforms 列表版本(你不选择提供方)。SDK 会为每个提供方自动为事件名称添加前缀,以 vgsdk_{prefix}_{event name} 形式发送: 请参阅 分析平台前缀。
// Sends to the SDK's default provider set (no platforms list)
VGSDKAnalytics.MiscCustomEvent("my_event", new Dictionary<string, string> { { "k", "v" } });Input
輸入
输入
| Field | Type | Description |
|---|---|---|
eventName | string | Event name. |
parameters | Dictionary<string, string> | Event parameters. |
| 欄位 | 型別 | 說明 |
|---|---|---|
eventName | string | 事件名稱。 |
parameters | Dictionary<string, string> | 事件參數。 |
| 字段 | 类型 | 描述 |
|---|---|---|
eventName | string | 事件名称。 |
parameters | Dictionary<string, string> | 事件参数。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Conversion Rate
1. App open
AndroidiOSLogs an app open.
記錄一次應用程式開啟。
记录一次应用打开。
VGSDKAnalytics.RegAppOpen(new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
2. Get configuration
AndroidiOSLogs the configuration fetch.
記錄設定的取得。
记录配置获取。
VGSDKAnalytics.RegGetConfiguration(new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
3. Check configuration start
AndroidiOSLogs the start of a configuration check.
記錄一次設定檢查的開始。
记录配置检查的开始。
VGSDKAnalytics.RegCheckConfigurationStart(new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
4. Check configuration end
AndroidiOSLogs the end of a configuration check.
記錄一次設定檢查的結束。
记录配置检查的结束。
VGSDKAnalytics.RegCheckConfigurationEnd(new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
5. CDN download start
AndroidiOSLogs the start of a CDN resource download.
記錄一次 CDN 資源下載的開始。
记录 CDN 资源下载的开始。
VGSDKAnalytics.RegCDNDownloadStart("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
6. CDN download 25%
AndroidiOSLogs 25% CDN download progress.
記錄 CDN 下載 25% 的進度。
记录 CDN 下载进度 25%。
VGSDKAnalytics.RegCDNDownload25("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
6. CDN download 50%
AndroidiOSLogs 50% CDN download progress.
記錄 CDN 下載 50% 的進度。
记录 CDN 下载进度 50%。
VGSDKAnalytics.RegCDNDownload50("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
6. CDN download 75%
AndroidiOSLogs 75% CDN download progress.
記錄 CDN 下載 75% 的進度。
记录 CDN 下载进度 75%。
VGSDKAnalytics.RegCDNDownload75("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. CDN download finish
AndroidiOSLogs CDN download completion.
記錄 CDN 下載完成。
记录 CDN 下载完成。
VGSDKAnalytics.RegCDNDownloadFinish("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
8. Extract resource start
AndroidiOSLogs the start of resource extraction.
記錄一次資源解壓的開始。
记录资源解压的开始。
VGSDKAnalytics.RegExtractResourceStart("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
9. Extract resource end
AndroidiOSLogs the end of resource extraction.
記錄一次資源解壓的結束。
记录资源解压的结束。
VGSDKAnalytics.RegExtractResourceEnd("10MB", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
size | string | Payload / resource size. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | string | 負載/資源大小。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | string | 负载 / 资源大小。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Onboarding
1. Joined server
AndroidiOSLogs a new user joining a server.
記錄新使用者加入伺服器。
记录新用户加入服务器。
VGSDKAnalytics.NruJoinedServer("server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
2. Named role
AndroidiOSLogs a role being named.
記錄角色被命名。
记录角色被命名。
VGSDKAnalytics.NruNamedRole("server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
3. Create role success
AndroidiOSLogs successful role creation.
記錄角色建立成功。
记录角色创建成功。
VGSDKAnalytics.NruCreateRoleSuccess("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
4. Tutorial start
AndroidiOSLogs the tutorial starting.
記錄教學開始。
记录教程开始。
VGSDKAnalytics.NruTutorialStart("role-1", "server-1", "0", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
progress | string | Progress marker. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
progress | string | 進度標記。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
progress | string | 进度标记。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
5. Tutorial 25%
AndroidiOSLogs 25% tutorial progress.
記錄教學 25% 的進度。
记录教程进度 25%。
VGSDKAnalytics.NruTutorialProgress25("role-1", "server-1", "25", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
progress | string | Progress marker. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
progress | string | 進度標記。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
progress | string | 进度标记。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
5. Tutorial 50%
AndroidiOSLogs 50% tutorial progress.
記錄教學 50% 的進度。
记录教程进度 50%。
VGSDKAnalytics.NruTutorialProgress50("role-1", "server-1", "50", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
progress | string | Progress marker. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
progress | string | 進度標記。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
progress | string | 进度标记。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
5. Tutorial 75%
AndroidiOSLogs 75% tutorial progress.
記錄教學 75% 的進度。
记录教程进度 75%。
VGSDKAnalytics.NruTutorialProgress75("role-1", "server-1", "75", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
progress | string | Progress marker. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
progress | string | 進度標記。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
progress | string | 进度标记。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
6. Tutorial finish
AndroidiOSLogs tutorial completion.
記錄教學完成。
记录教程完成。
VGSDKAnalytics.NruTutorialProgressFinish("role-1", "server-1", "100", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
progress | string | Progress marker. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
progress | string | 進度標記。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
progress | string | 进度标记。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. Open shop
AndroidiOSLogs the shop being opened.
記錄商店被開啟。
记录商店被打开。
VGSDKAnalytics.IapOpenShop("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. Click to buy
AndroidiOSLogs the intent to buy an item.
記錄購買道具的意圖。
记录购买物品的意向。
VGSDKAnalytics.IapClickToBuyItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
itemId | string | Item id. |
itemName | string | Item name. |
itemPrice | string | Item price. |
itemCurrency | string | Currency code. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
itemId | string | 道具 ID。 |
itemName | string | 道具名稱。 |
itemPrice | string | 道具價格。 |
itemCurrency | string | 貨幣代碼。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
itemId | string | 物品 id。 |
itemName | string | 物品名称。 |
itemPrice | string | 物品价格。 |
itemCurrency | string | 货币代码。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. Purchased item
AndroidiOSLogs a completed purchase.
記錄一次完成的購買。
记录一次完成的购买。
VGSDKAnalytics.IapPurchasedItem("role-1", "server-1", "item-1", "Gold Pack", "22000", "VND", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
itemId | string | Item id. |
itemName | string | Item name. |
itemPrice | string | Item price. |
itemCurrency | string | Currency code. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
itemId | string | 道具 ID。 |
itemName | string | 道具名稱。 |
itemPrice | string | 道具價格。 |
itemCurrency | string | 貨幣代碼。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
itemId | string | 物品 id。 |
itemName | string | 物品名称。 |
itemPrice | string | 物品价格。 |
itemCurrency | string | 货币代码。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. VIP level up
AndroidiOSLogs a VIP tier increase.
記錄 VIP 等級提升。
记录 VIP 等级提升。
VGSDKAnalytics.IapVipLevelUp("role-1", "server-1", "3", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
currentVipLevel | string | New VIP level. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
currentVipLevel | string | 新的 VIP 等級。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
currentVipLevel | string | 新的 VIP 等级。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. Buy VIP reward level
AndroidiOSLogs the purchase of a VIP reward level.
記錄購買 VIP 獎勵等級。
记录购买 VIP 奖励等级。
VGSDKAnalytics.IapBuyVipRewardLevel("role-1", "server-1", "item-1", "VIP Pack", "3", "22000", "VND", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
itemId | string | Item id. |
itemName | string | Item name. |
itemVipLevel | string | VIP level of the item. |
itemPrice | string | Item price. |
itemCurrency | string | Currency code. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
itemId | string | 道具 ID。 |
itemName | string | 道具名稱。 |
itemVipLevel | string | 道具的 VIP 等級。 |
itemPrice | string | 道具價格。 |
itemCurrency | string | 貨幣代碼。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
itemId | string | 物品 id。 |
itemName | string | 物品名称。 |
itemVipLevel | string | 物品的 VIP 等级。 |
itemPrice | string | 物品价格。 |
itemCurrency | string | 货币代码。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. Level up
AndroidiOSLogs a character level-up.
記錄角色升級。
记录角色升级。
VGSDKAnalytics.MdaLevelUp("role-1", "server-1", "42", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
currentLevel | string | New level. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
currentLevel | string | 新的等級。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
currentLevel | string | 新的等级。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
7. Agree to terms
AndroidiOSLogs acceptance of all terms.
記錄同意所有條款。
记录接受所有条款。
VGSDKAnalytics.NruAgreeAllTerm(new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Main & Daily Activities
Main quest
AndroidiOSLogs main-quest progress.
記錄主線任務的進度。
记录主线任务进度。
VGSDKAnalytics.MdaMainQuest("role-1", "server-1", "q1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
mainQuestId | string | Main-quest id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
mainQuestId | string | 主線任務 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
mainQuestId | string | 主线任务 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Daily quest
AndroidiOSLogs daily-quest progress.
記錄每日任務的進度。
记录每日任务进度。
VGSDKAnalytics.MdaDailyQuest("role-1", "server-1", "d1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
dailyQuestId | string | Daily-quest id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
dailyQuestId | string | 每日任務 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
dailyQuestId | string | 每日任务 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Grant daily reward
AndroidiOSLogs a daily reward grant.
記錄一次每日獎勵的發放。
记录发放一次每日奖励。
VGSDKAnalytics.MdaGrantDailyReward("role-1", "server-1", "r1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
dailyRewardId | string | Daily-reward id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
dailyRewardId | string | 每日獎勵 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
dailyRewardId | string | 每日奖励 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Buy item
AndroidiOSLogs an in-game (soft-currency) item purchase.
記錄一次遊戲內(軟性貨幣)道具購買。
记录一次游戏内(软通货)物品购买。
VGSDKAnalytics.MdaBuyItem("role-1", "server-1", "item-1", "Potion", "100", "gold", "5", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
itemId | string | Item id. |
itemName | string | Item name. |
itemPrice | string | Item price. |
itemCurrency | string | Currency code. |
itemQuantity | string | Item quantity. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
itemId | string | 道具 ID。 |
itemName | string | 道具名稱。 |
itemPrice | string | 道具價格。 |
itemCurrency | string | 貨幣代碼。 |
itemQuantity | string | 道具數量。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
itemId | string | 物品 id。 |
itemName | string | 物品名称。 |
itemPrice | string | 物品价格。 |
itemCurrency | string | 货币代码。 |
itemQuantity | string | 物品数量。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Spend item
AndroidiOSLogs spending/consuming an item.
記錄花費/消耗道具。
记录消耗 / 使用一个物品。
VGSDKAnalytics.MdaSpendItem("role-1", "server-1", "item-1", "Potion", "100", "gold", "5", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
itemId | string | Item id. |
itemName | string | Item name. |
itemPrice | string | Item price. |
itemCurrency | string | Currency code. |
itemQuantity | string | Item quantity. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
itemId | string | 道具 ID。 |
itemName | string | 道具名稱。 |
itemPrice | string | 道具價格。 |
itemCurrency | string | 貨幣代碼。 |
itemQuantity | string | 道具數量。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
itemId | string | 物品 id。 |
itemName | string | 物品名称。 |
itemPrice | string | 物品价格。 |
itemCurrency | string | 货币代码。 |
itemQuantity | string | 物品数量。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Gacha
AndroidiOSLogs a gacha pull.
記錄一次轉蛋抽取。
记录一次抽卡。
VGSDKAnalytics.MdaGacha("role-1", "server-1", "banner-a", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
gachaType | string | Gacha type/banner. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
gachaType | string | 轉蛋類型/卡池。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
gachaType | string | 抽卡类型 / 卡池。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Social & Communities
Create guild
AndroidiOSLogs a guild-creation event.
記錄一次公會建立事件。
记录一次公会创建事件。
VGSDKAnalytics.ScCreateGuild("role-1", "server-1", "g1", "Guild", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
guildId | string | Guild id. |
guildName | string | Guild name. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
guildId | string | 公會 ID。 |
guildName | string | 公會名稱。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
guildId | string | 公会 id。 |
guildName | string | 公会名称。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Join guild
AndroidiOSLogs a guild-join event.
記錄一次加入公會事件。
记录一次加入公会事件。
VGSDKAnalytics.ScJoinGuild("role-1", "server-1", "g1", "Guild", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
guildId | string | Guild id. |
guildName | string | Guild name. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
guildId | string | 公會 ID。 |
guildName | string | 公會名稱。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
guildId | string | 公会 id。 |
guildName | string | 公会名称。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Quit guild
AndroidiOSLogs a guild-quit event.
記錄一次退出公會事件。
记录一次退出公会事件。
VGSDKAnalytics.ScQuitGuild("role-1", "server-1", "g1", "Guild", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
guildId | string | Guild id. |
guildName | string | Guild name. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
guildId | string | 公會 ID。 |
guildName | string | 公會名稱。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
guildId | string | 公会 id。 |
guildName | string | 公会名称。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Add friend
AndroidiOSLogs adding a friend on a platform.
記錄在平台上新增一位好友。
记录在某平台上添加好友。
VGSDKAnalytics.ScAddFriendToList("role-1", "server-1", "facebook", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
platform | string | Social platform name. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
platform | string | 社群平台名稱。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
platform | string | 社交平台名称。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Remove friend
AndroidiOSLogs removing a friend on a platform.
記錄在平台上移除一位好友。
记录在某平台上移除好友。
VGSDKAnalytics.ScRemoveFriendFromList("role-1", "server-1", "facebook", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
platform | string | Social platform name. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
platform | string | 社群平台名稱。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
platform | string | 社交平台名称。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Share to Facebook
AndroidiOSLogs a share-to-Facebook event.
記錄一次分享到 Facebook 的事件。
记录一次分享到 Facebook 的事件。
VGSDKAnalytics.ScShareToFacebook("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Invite Facebook friend
AndroidiOSLogs a Facebook friend-invite event.
記錄一次 Facebook 好友邀請事件。
记录一次 Facebook 好友邀请事件。
VGSDKAnalytics.ScInviteFacebookFriend("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Share to Instagram
AndroidiOSLogs a share-to-Instagram event.
記錄一次分享到 Instagram 的事件。
记录一次分享到 Instagram 的事件。
VGSDKAnalytics.ScShareToInstagram("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Other
Splash screen
AndroidiOSLogs the splash screen being shown.
記錄啟動畫面被顯示。
记录启动画面的展示。
VGSDKAnalytics.RegSplashScreen(new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Purchase canceled
AndroidiOSLogs a canceled purchase.
記錄一次已取消的購買。
记录一次已取消的购买。
VGSDKAnalytics.IapPurchasedCanceledItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
itemId | string | Item id. |
itemName | string | Item name. |
itemPrice | string | Item price. |
itemCurrency | string | Currency code. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
itemId | string | 道具 ID。 |
itemName | string | 道具名稱。 |
itemPrice | string | 道具價格。 |
itemCurrency | string | 貨幣代碼。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
itemId | string | 物品 id。 |
itemName | string | 物品名称。 |
itemPrice | string | 物品价格。 |
itemCurrency | string | 货币代码。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Switch account
AndroidiOSLogs an account switch.
記錄一次帳號切換。
记录一次账号切换。
VGSDKAnalytics.MiscSwitchAccount("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Customer support
AndroidiOSLogs a customer-support entry.
記錄一次進入客戶支援。
记录一次进入客户支持。
VGSDKAnalytics.MiscCustomerSupport("role-1", "server-1", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | string | Character/role id. |
serverId | string | Game server id. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | string | 角色 ID。 |
serverId | string | 遊戲伺服器 ID。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | string | 角色 id。 |
serverId | string | 游戏服务器 id。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Ad revenue
AndroidiOSReports ad revenue through the unified analytics facade.
透過統一分析介面回報廣告收益。
通过统一分析接口上报广告收入。
// Reports ad revenue through the unified analytics facade
VGSDKAnalytics.MiscAdRevenue("AdMob", VGSDKAdRevenueMediationNetwork.GoogleAdMob,
22000, "VND", new Dictionary<string, string>());Input
輸入
输入
| Field | Type | Description |
|---|---|---|
monetizationNetwork | string | Monetization network name. |
mediationNetwork | VGSDKAdRevenueMediationNetwork | Mediation network: see Ad revenue mediation network. |
revenue | double | Revenue amount. |
currencyCode | string | Currency code. |
extraData | Dictionary<string, string> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
monetizationNetwork | string | 營利聯播網名稱。 |
mediationNetwork | VGSDKAdRevenueMediationNetwork | 中介聯播網: 請參閱 廣告收益中介聯播網。 |
revenue | double | 收益金額。 |
currencyCode | string | 貨幣代碼。 |
extraData | Dictionary<string, string> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
monetizationNetwork | string | 变现网络名称。 |
mediationNetwork | VGSDKAdRevenueMediationNetwork | 聚合网络: 请参阅 广告收入聚合网络。 |
revenue | double | 收入金额。 |
currencyCode | string | 货币代码。 |
extraData | Dictionary<string, string> | 附加到该事件的额外自定义键值对。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Customer Support
Open the in-app support center, signed in and pre-filled with the player’s context. Results arrive on the listener’s closures.
開啟應用程式內的支援中心,已登入並預先填入玩家的情境資料。結果會透過監聽器的閉包傳回。
打开应用内客户支持中心,已登录并预填了玩家的上下文。结果在监听器的闭包上返回。
Open support center
AndroidiOSPresents the support center for the player.
為玩家顯示支援中心。
为玩家展示客户支持中心。
var info = new Dictionary<string, string> { { "userId", userId }, { "serverId", serverId } };
VGSDKSupport.OpenSupportCenter(info, result =>
{
result.Match(
listener => { /* Type == "action" → listener.Data payload; "closed" → dismissed */ },
error => { /* handle failure: error.StringCode, error.Message */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
info | Dictionary<string, string> | Player context: full model: VGSDKSupportInfo. |
info.userId | string | Unique VNGGames user id. |
info.serverId | string | Game server id. |
info.level | string | Player level. |
info.roleName | string | Character/role name. |
info.loginChannel | string | Login channel. |
info.guild | string | Guild name. |
info.content | string | Pre-filled ticket content. |
| 欄位 | 型別 | 說明 |
|---|---|---|
info | Dictionary<string, string> | 玩家情境: 完整模型:VGSDKSupportInfo。 |
info.userId | string | 使用者 ID。 |
info.serverId | string | 伺服器 ID。 |
info.level | string | 玩家等級。 |
info.roleName | string | 角色名稱。 |
info.loginChannel | string | 登入頻道。 |
info.guild | string | 公會名稱。 |
info.content | string | 預先填入的工單內容。 |
| 字段 | 类型 | 描述 |
|---|---|---|
info | Dictionary<string, string> | 玩家上下文: 完整模型:VGSDKSupportInfo。 |
info.userId | string | 用户 id。 |
info.serverId | string | 服务器 id。 |
info.level | string | 玩家等级。 |
info.roleName | string | 角色名称。 |
info.loginChannel | string | 登录渠道。 |
info.guild | string | 公会名称。 |
info.content | string | 预填的工单内容。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | VGSDKSupportCenterListener | Support-center event listener: Type is "action" (an in-portal action the player took, and Data holds its payload) or "closed" (the player dismissed the support center). Data is a Dictionary<string, object>. Failures surface on error, not here. |
error | Error | An error occurred: see General error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | VGSDKSupportCenterListener | 支援中心事件監聽器: Type 為 "action"(玩家在支援中心內執行的操作,Data 為其負載)或 "closed"(玩家關閉了支援中心)。Data 為 Dictionary<string, object>。失敗會透過 error 回傳,而非於此處。 |
error | Error | 發生錯誤: 請參閱 一般錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | VGSDKSupportCenterListener | 客户支持中心事件监听器: Type 为 "action"(玩家在门户内执行的操作,Data 为其负载)或 "closed"(玩家关闭了客户支持中心)。Data 为 Dictionary<string, object>。失败通过 error 返回,而非此处。 |
error | Error | 发生了错误: 请参阅 通用错误码。 |
In-App Ads
Monetize with ironSource-mediated rewarded video, or Meta Audience Network interstitial / rewarded formats. Ad events arrive on the listener objects you pass in: there is no status enum.
透過 ironSource 中介的獎勵影片,或 Meta Audience Network 的插頁式/獎勵式格式進行營利。廣告事件會透過你傳入的監聽器物件傳回: 沒有狀態列舉。
通过 ironSource 聚合的激励视频,或 Meta Audience Network 的插屏 / 激励格式进行变现。广告事件在你传入的监听器对象上返回: 没有状态枚举。
ironSource
Initialize ironSource
AndroidiOSInitializes ironSource with an init listener and a rewarded-video listener.
以初始化監聽器與獎勵影片監聽器初始化 ironSource。
使用一个初始化监听器和一个激励视频监听器来初始化 ironSource。
PassSDK.Instance.IronSourceInit(userId, result =>
{
result.Match(
reward => { /* reward.Placement, reward.RewardedVideoStatus */ },
error => { /* init/show failure */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
userID | string | Player id for the reward callback. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | string | 用於獎勵回呼的玩家 ID。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | string | 用于奖励回调的玩家 id。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassISRewardVideo | Rewarded-video ad/reward event. The callback is delivered here for every ironSource ad and reward event: for this initialize and every later Show rewarded video: as one PassISRewardVideo with the fields below. |
value.Placement | string | The ironSource placement the event belongs to. |
value.RewardedVideoStatus | RewardedVideoStatus | The ad/reward lifecycle event: see RewardedVideoStatus. |
value.AdInfo | string | Ad metadata for the event, as a JSON string, when the mediation network provides it. |
value.Message | string | Event message. On adShowFailed (3) it carries the native ironSource error text: there is no VGSDK error code for ironSource rewarded video. |
error | Error | Present only on an SDK-level failure of the call itself: e.g. -1 (see General error codes). Ad-level failures are NOT reported here: they arrive on value as RewardedVideoStatus.adShowFailed (3) with the native error in Message. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassISRewardVideo | 獎勵影片廣告/獎勵事件。本次初始化及之後每次「顯示獎勵影片」的每個 ironSource 廣告與獎勵事件,都會作為一個 PassISRewardVideo(含以下欄位)送達這裡。 |
value.Placement | string | 該事件所屬的 ironSource 版位。 |
value.RewardedVideoStatus | RewardedVideoStatus | 廣告/獎勵生命週期事件: 請參閱 RewardedVideoStatus。 |
value.AdInfo | string | 該事件的廣告中繼資料,為 JSON 字串(當中介網路提供時)。 |
value.Message | string | 事件訊息。在 adShowFailed(3)時攜帶原生 ironSource 錯誤文字: ironSource 獎勵影片沒有 VGSDK 錯誤碼。 |
error | Error | 僅在呼叫本身發生 SDK 級失敗時存在: 例如 -1(請參閱 一般錯誤碼)。廣告級失敗不在此回報: 它們透過 value 以 RewardedVideoStatus.adShowFailed(3)送達,錯誤位於 Message 中。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassISRewardVideo | 激励视频广告/奖励事件。本次初始化及之后每次“展示激励视频”的每个 ironSource 广告与奖励事件,都会作为一个 PassISRewardVideo(含以下字段)送达这里。 |
value.Placement | string | 该事件所属的 ironSource 广告位。 |
value.RewardedVideoStatus | RewardedVideoStatus | 广告/奖励生命周期事件: 请参阅 RewardedVideoStatus。 |
value.AdInfo | string | 该事件的广告元数据,为 JSON 字符串(当聚合网络提供时)。 |
value.Message | string | 事件消息。在 adShowFailed(3)时携带原生 ironSource 错误文本: ironSource 激励视频没有 VGSDK 错误码。 |
error | Error | 仅在调用本身发生 SDK 级失败时存在: 例如 -1(请参阅 通用错误码)。广告级失败不在此报告: 它们通过 value 以 RewardedVideoStatus.adShowFailed(3)送达,错误位于 Message 中。 |
Show rewarded video
AndroidiOSShows a rewarded video for a placement. Ad events arrive on the rewarded-video listener.
為某個版位顯示獎勵影片。廣告事件會透過獎勵影片監聽器傳回。
为某个广告位展示激励视频。广告事件在激励视频监听器上返回。
// Ad/reward events arrive on the listener passed to IronSourceInit.
PassSDK.Instance.IronSourceShowVideoAd("DefaultRewardedVideo", "true");Input
輸入
输入
| Field | Type | Description |
|---|---|---|
placementName | string | Placement to show. |
isTrackNetworkState | string | Whether to track network state (“true”/“false”). |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementName | string | 要顯示的版位。 |
isTrackNetworkState | string | 是否追蹤網路狀態(“true”/“false”)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementName | string | 要展示的广告位。 |
isTrackNetworkState | string | 是否跟踪网络状态(“true”/“false”)。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Set dynamic user id
AndroidiOSUpdates the ironSource dynamic user id used for server-to-server reward callbacks.
更新用於伺服器對伺服器獎勵回呼的 ironSource 動態使用者 ID。
更新用于服务端到服务端奖励回调的 ironSource 动态用户 id。
PassSDK.Instance.IronSourceSetDynamicUserId(userId);Input
輸入
输入
| Field | Type | Description |
|---|---|---|
userID | string | Dynamic user id for verifying rewarded-ad transactions: set before showing the ad, returned in the server-to-server reward callback (1 to 64 alphanumeric characters). |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | string | 用於驗證獎勵廣告交易的動態使用者 ID: 需在顯示廣告前設定。會在伺服器對伺服器獎勵回呼中回傳(1 至 64 個英數字元)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | string | 用于验证激励广告交易的动态用户 id: 需在展示广告前设置。会在服务端到服务端奖励回调中返回(1 至 64 个字母数字字符)。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Meta Audience Network
Show interstitial
AndroidiOSShows a Meta Audience Network interstitial.
顯示 Meta Audience Network 插頁式廣告。
展示一个 Meta Audience Network 插屏广告。
VGSDKMetaAds.ShowInterstitial("YOUR_PLACEMENT_ID", result =>
{
result.Match(
ad => { /* ad.Status, ad.AdInfo */ },
error => { /* load/show failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
placementId | string | Meta placement id. |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementId | string | Meta 版位 ID。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementId | string | Meta 广告位 id。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | VGSDKMetaAdsInterstitialListener | Ad-event listener. |
value.Status | VGSDKMetaAdsInterstitialStatus | The interstitial ad event: see VGSDKMetaAdsInterstitialStatus. |
value.AdInfo | string | Ad metadata for the event, as a JSON string. |
error | Error | Load/show failed: carries the native Meta AdError (not a VGSDK code). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | VGSDKMetaAdsInterstitialListener | 廣告事件監聽器。 |
value.Status | VGSDKMetaAdsInterstitialStatus | 插頁式廣告事件: 請參閱 VGSDKMetaAdsInterstitialStatus。 |
value.AdInfo | string | 該事件的廣告中繼資料(JSON 字串)。 |
error | Error | 載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | VGSDKMetaAdsInterstitialListener | 广告事件监听器。 |
value.Status | VGSDKMetaAdsInterstitialStatus | 插屏广告事件: 请参阅 VGSDKMetaAdsInterstitialStatus。 |
value.AdInfo | string | 该事件的广告元数据(JSON 字符串)。 |
error | Error | 加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。 |
Show rewarded video
AndroidiOSShows a Meta rewarded video. A complete closure fires when the reward is earned.
顯示 Meta 獎勵影片。當獲得獎勵時會觸發 complete 閉包。
展示一个 Meta 激励视频。获得奖励时触发 complete 闭包。
VGSDKMetaAds.ShowRewardedVideo("YOUR_PLACEMENT_ID", userId, "USD", result =>
{
result.Match(
ad => { /* ad.Status, ad.AdInfo */ },
error => { /* load/show failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
placementId | string | Meta placement id. |
userId | string | Player id for the reward callback. |
currency | string | Reward currency name. |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementId | string | Meta 版位 ID。 |
userId | string | 用於獎勵回呼的玩家 ID。 |
currency | string | 獎勵貨幣名稱。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementId | string | Meta 广告位 id。 |
userId | string | 用于奖励回调的玩家 id。 |
currency | string | 奖励货币名称。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | VGSDKMetaAdsRewardedVideoListener | Ad-event listener. |
value.Status | VGSDKMetaAdsRewardedVideoStatus | The ad/reward event: see VGSDKMetaAdsRewardedVideoStatus. |
value.AdInfo | string | Ad metadata for the event, as a JSON string. |
error | Error | Load/show failed: carries the native Meta AdError (not a VGSDK code). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | VGSDKMetaAdsRewardedVideoListener | 廣告事件監聽器。 |
value.Status | VGSDKMetaAdsRewardedVideoStatus | 廣告/獎勵事件: 請參閱 VGSDKMetaAdsRewardedVideoStatus。 |
value.AdInfo | string | 該事件的廣告中繼資料(JSON 字串)。 |
error | Error | 載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | VGSDKMetaAdsRewardedVideoListener | 广告事件监听器。 |
value.Status | VGSDKMetaAdsRewardedVideoStatus | 广告/奖励事件: 请参阅 VGSDKMetaAdsRewardedVideoStatus。 |
value.AdInfo | string | 该事件的广告元数据(JSON 字符串)。 |
error | Error | 加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。 |
Show rewarded interstitial
AndroidiOSShows a Meta rewarded-interstitial (skippable rewarded format), with the same closure set as rewarded video.
顯示 Meta 獎勵式插頁廣告(可略過的獎勵格式),使用與獎勵影片相同的閉包集合。
展示一个 Meta 激励插屏广告(可跳过的激励格式),闭包集合与激励视频相同。
VGSDKMetaAds.ShowRewardedInterstitial("YOUR_PLACEMENT_ID", userId, "USD", result =>
{
result.Match(
ad => { /* ad.Status, ad.AdInfo */ },
error => { /* load/show failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
placementId | string | Meta placement id. |
userId | string | Player id for the reward callback. |
currency | string | Reward currency name. |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementId | string | Meta 版位 ID。 |
userId | string | 用於獎勵回呼的玩家 ID。 |
currency | string | 獎勵貨幣名稱。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementId | string | Meta 广告位 id。 |
userId | string | 用于奖励回调的玩家 id。 |
currency | string | 奖励货币名称。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | VGSDKMetaAdsRewardedInterstitialListener | Ad-event listener. |
value.Status | VGSDKMetaAdsRewardedInterstitialStatus | The ad/reward event: see VGSDKMetaAdsRewardedInterstitialStatus. |
value.AdInfo | string | Ad metadata for the event, as a JSON string. |
error | Error | Load/show failed: carries the native Meta AdError (not a VGSDK code). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | VGSDKMetaAdsRewardedInterstitialListener | 廣告事件監聽器。 |
value.Status | VGSDKMetaAdsRewardedInterstitialStatus | 廣告/獎勵事件: 請參閱 VGSDKMetaAdsRewardedInterstitialStatus。 |
value.AdInfo | string | 該事件的廣告中繼資料(JSON 字串)。 |
error | Error | 載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | VGSDKMetaAdsRewardedInterstitialListener | 广告事件监听器。 |
value.Status | VGSDKMetaAdsRewardedInterstitialStatus | 广告/奖励事件: 请参阅 VGSDKMetaAdsRewardedInterstitialStatus。 |
value.AdInfo | string | 该事件的广告元数据(JSON 字符串)。 |
error | Error | 加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。 |
Engage
Re-engagement, grouped by provider. CleverTap covers in-app messaging and the app inbox. Apollo messaging/inbox is backend-driven, so the client’s only touchpoint is the game context it targets on. Firebase Remote Config and the in-app WebView round it out. Firebase Cloud Messaging, local push, Apollo (push / in-app / inbox), and Firebase in-app messages are delivered server-side and expose no client call.
再行銷,依供應商分組。CleverTap 涵蓋應用程式內訊息與應用程式收件匣。Apollo 的訊息/收件匣由後端驅動,因此用戶端唯一的接觸點是它所鎖定的遊戲情境。Firebase Remote Config 與應用程式內 WebView 補足其餘部分。Firebase Cloud Messaging、本機推播、Apollo(推播/應用程式內/收件匣)以及 Firebase 應用程式內訊息皆由伺服器端傳遞,不提供任何用戶端呼叫。
按提供方分组的再互动能力。CleverTap 负责应用内消息和应用收件箱。Apollo 的消息 / 收件箱由后端驱动,因此客户端唯一的接触点是它所定位的游戏上下文。此外还有 Firebase Remote Config 和应用内 WebView。Firebase Cloud Messaging、本地推送、Apollo(推送 / 应用内 / 收件箱)以及 Firebase 应用内消息均由服务端下发,不暴露客户端调用。
CleverTap
Set CleverTap listener
AndroidiOSRegisters a CleverTap listener for in-app message button taps.
註冊 CleverTap 監聽器以接收應用程式內訊息按鈕的點擊。
注册一个用于监听应用内消息按钮点击的 CleverTap 监听器。
// In-app-message button taps:
PassSDK.Instance.OnCleverTapInAppButtonClick(result =>
{
result.Match(payload => { /* payload = tapped button data */ }, error => { });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | Dictionary<string, string> | Payload of the tapped in-app-message button. |
error | Error | Present on failure. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | Dictionary<string, string> | 被點擊的應用程式內訊息按鈕的負載。 |
error | Error | 失敗時存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | Dictionary<string, string> | 被点击的应用内消息按钮的负载。 |
error | Error | 失败时存在。 |
Open the app inbox
AndroidiOSOpens the CleverTap-backed inbox.
開啟以 CleverTap 為後端的收件匣。
打开由 CleverTap 支持的收件箱。
VGSDKAppInbox.Open(new VGSDKAppInboxCleverTapProvider(new VGSDKAppInboxCleverTapStyle()), result =>
{
result.Match(inbox => { /* inbox.Message / inbox.MessageContent */ }, error => { });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
provider | VGSDKAppInboxProvider | The CleverTap app-inbox provider. |
| 欄位 | 型別 | 說明 |
|---|---|---|
provider | VGSDKAppInboxProvider | CleverTap 應用程式收件匣供應商。 |
| 字段 | 类型 | 描述 |
|---|---|---|
provider | VGSDKAppInboxProvider | CleverTap 应用收件箱提供方。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | VGSDKAppInboxListener | The tapped message, its content, and any CTA button payload. |
error | Error | Present on failure. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | VGSDKAppInboxListener | 被點擊的訊息、其內容,以及任何 CTA 負載。 |
error | Error | 失敗時存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | VGSDKAppInboxListener | 被点击的消息、其内容以及任何 CTA 负载。 |
error | Error | 失败时存在。 |
Apollo
Set the game context
AndroidiOSRegisters the active role/server. Apollo messaging and inbox target on this context, and analytics and support also read it. Both ids must be non-empty or the call is ignored.
註冊使用中的角色/伺服器。Apollo 的訊息與收件匣會以此情境為鎖定目標。分析與支援也會讀取它。兩個 ID 都必須為非空,否則此呼叫會被忽略。
注册当前的角色 / 服务器。Apollo 的消息和收件箱基于此上下文定位。分析与客户支持也会读取它。两个 id 都必须非空,否则该调用被忽略。
VGSDK.SetGameContext(new VGSDKGameContext { RoleId = roleId, ServerId = serverId });Input
輸入
输入
| Field | Type | Description |
|---|---|---|
context | VGSDKGameContext | Wrapper describing the active session. |
context.RoleId | string | Active character/role id (must be non-empty). |
context.ServerId | string | Active server id (must be non-empty). |
| 欄位 | 型別 | 說明 |
|---|---|---|
context | VGSDKGameContext | 描述目前工作階段的包裝物件。 |
context.RoleId | string | 目前的角色 id(不得為空)。 |
context.ServerId | string | 目前的伺服器 id(不得為空)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
context | VGSDKGameContext | 描述当前会话的包装对象。 |
context.RoleId | string | 当前的角色 id(不得为空)。 |
context.ServerId | string | 当前的服务器 id(不得为空)。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Set in-app-message deep-link listener
AndroidiOSRegisters a listener for deep links fired by Apollo in-app messages / inbox.
註冊監聽器以接收 Apollo 應用程式內訊息/收件匣觸發的深層連結。
注册一个用于监听 Apollo 应用内消息 / 收件箱触发的深链的监听器。
VGSDKAppInbox.SetInAppMessageDeepLinkListener(url =>
{
/* route the in-app-message deep link */
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
listener | Action<string> | The listener to register (pass none to clear it). |
| 欄位 | 型別 | 說明 |
|---|---|---|
listener | Action<string> | 要註冊的監聽器(傳入無則清除)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
listener | Action<string> | 要注册的监听器(传入无则清除)。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Show the app inbox floating button
AndroidiOSDisplays the Apollo app inbox floating button and takes its visibility over for the rest of the session.
顯示 Apollo 應用程式內收件匣的浮動按鈕,並在本次工作階段接手其顯示與隱藏。
显示 Apollo 应用内收件箱的悬浮按钮,并在本次会话接手其显示与隐藏。
The first call to either visibility method hands the button to your game for the rest of the session, so the SDK stops showing and hiding it on its own. The hand over resets on logout and on relaunch. A call made while the app inbox is disabled for your game is accepted and reported in the SDK log as having no effect.
第一次呼叫任一個顯示控制方法後,按鈕即在本次工作階段交由遊戲控制,SDK 不再自行顯示或隱藏它。此控制權會在登出與重新啟動時歸還 SDK。若你的遊戲未啟用應用程式內收件匣,呼叫仍會被接受,並在 SDK 日誌中回報為未產生效果。
第一次调用任一个显示控制方法后,按钮即在本次会话交由游戏控制,SDK 不再自行显示或隐藏它。该控制权会在登出与重新启动时归还 SDK。若你的游戏未启用应用内收件箱,调用仍会被接受,并在 SDK 日志中报告为未产生效果。
VGSDKAppInbox.ShowFloatingButton();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Hide the app inbox floating button
AndroidiOSRemoves the Apollo app inbox floating button and takes its visibility over for the rest of the session.
移除 Apollo 應用程式內收件匣的浮動按鈕,並在本次工作階段接手其顯示與隱藏。
移除 Apollo 应用内收件箱的悬浮按钮,并在本次会话接手其显示与隐藏。
The dismiss zone and any open confirmation popup go with it, and a drag in progress is cancelled immediately. The button’s last position survives, so a later show restores it. An open message list is left untouched, and a message arriving while the button is hidden still updates the unread count.
移除按鈕時,拖曳關閉區與任何開啟中的確認彈窗會一併移除,正在進行的拖曳也會立即取消。按鈕最後的位置會保留,因此之後呼叫顯示時會回到原處。開啟中的訊息列表不受影響,按鈕隱藏期間收到的訊息仍會更新未讀數量。
移除按钮时,拖拽关闭区与任何打开中的确认弹窗会一并移除,正在进行的拖拽也会立即取消。按钮最后的位置会保留,因此之后调用显示时会回到原处。打开中的消息列表不受影响,按钮隐藏期间收到的消息仍会更新未读数量。
VGSDKAppInbox.HideFloatingButton();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Firebase
Fetch Firebase Remote Config
AndroidiOSFetches all remote-config keys.
取得所有 remote-config 鍵。
获取所有 remote-config 键。
PassSDK.Instance.FirebaseRemoteConfig(result =>
{
result.Match(
config => { /* all remote-config keys and values (JSON) */ },
error => { /* handle failure */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | All remote-config keys and values. |
error | Error | Present on failure: VGSDK firebaseUnsupported (9047, see General error codes) when the Firebase dependency is missing, otherwise the raw native Firebase Remote Config error (fetch/activate failure). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 所有遠端設定的鍵與值。 |
error | Error | 失敗時存在: 缺少 Firebase 相依套件時為 VGSDK firebaseUnsupported(9047。請參閱 一般錯誤碼),否則為原生 Firebase Remote Config 錯誤(fetch/activate 失敗)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 所有远程配置的键与值。 |
error | Error | 失败时存在: 缺少 Firebase 依赖时为 VGSDK firebaseUnsupported(9047。请参阅 通用错误码),否则为原生 Firebase Remote Config 错误(fetch/activate 失败)。 |
In-App WebView
Show in-app WebView
AndroidiOSOpens a URL in an in-app WebView.
在應用程式內 WebView 中開啟一個 URL。
在应用内 WebView 中打开一个 URL。
PassSDK.Instance.ShowWebView("https://event.yourgame.com", result =>
{
result.Match(_ => { /* WebView dismissed */ }, error => { });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
url | string | URL to load. |
| 欄位 | 型別 | 說明 |
|---|---|---|
url | string | 要載入的 URL。 |
| 字段 | 类型 | 描述 |
|---|---|---|
url | string | 要加载的 URL。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Fires when the WebView is dismissed. |
error | Error | Failed to open the WebView: an Error wrapping a message string (no VGSDK code). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 當 WebView 關閉時觸發。 |
error | Error | 開啟 WebView 失敗: 一個包裝訊息字串的 Error(無 VGSDK 代碼)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 当 WebView 关闭时触发。 |
error | Error | 打开 WebView 失败: 一个包装消息字符串的 Error(无 VGSDK 代码)。 |
Notification
Add a custom sound
Deliver a custom sound with push notifications: no API call, just a build-time asset drop:
- Prepare your sound file(s): a platform-appropriate audio file for each platform you ship. One filename can serve both if it satisfies both rule sets.
- Copy the file(s) into
Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/: directly insound/. - Build normally for Android or iOS: no script changes. The post-build processor copies the file automatically.
- Reference the sound in your push / notification payload, per platform:
- Android: by resource name (filename without extension), e.g.
my_notificationformy_notification.mp3. Extensions.mp3/.wav/.ogg. Keep it a short tone. The filename must be lowercase letters, digits, and underscores only ([a-z0-9_]). - iOS: by full filename (with extension), e.g.
my_notification.caf. Extensions.caf/.aiff/.wav. Maximum 30 seconds (longer sounds fall back to the system default).
- Android: by resource name (filename without extension), e.g.
為推播通知提供自訂音效:無需 API 呼叫,只是建置時的資源放置:
- 準備你的音效檔案:為每個要發佈的平台提供合適格式的音訊檔案。若一個檔名同時滿足兩個平台的規則,也可通用於兩個平台。
- 將檔案複製到
Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/,直接放在sound/目錄下。 - 正常建置 Android 或 iOS:無需修改任何指令碼,建置後處理器會自動複製檔案。
- 引用該音效:於你的推播 / 通知負載中依平台慣例引用:
- Android:透過資源名稱(去除副檔名的檔名)引用,例如
my_notification.mp3用my_notification。副檔名:.mp3/.wav/.ogg。保持為簡短提示音。檔名只能是小寫字母、數字與底線([a-z0-9_])。 - iOS:透過完整檔名(含副檔名)引用,例如
my_notification.caf。副檔名:.caf/.aiff/.wav。最長 30 秒。超過則回退為系統預設音效。
- Android:透過資源名稱(去除副檔名的檔名)引用,例如
为推送通知提供自定义声音:无需 API 调用,只是构建时的资源放置:
- 准备你的声音文件:为每个要发布的平台提供合适格式的音频文件。如果一个文件名同时满足两个平台的规则,也可以通用于两个平台。
- 将文件复制到
Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/,直接放在sound/目录下。 - 正常构建 Android 或 iOS:无需修改任何脚本,构建后处理器会自动复制文件。
- 引用该声音:在你的推送 / 通知负载中按平台约定引用:
- Android:通过资源名(去掉扩展名的文件名)引用,例如
my_notification.mp3用my_notification。扩展名:.mp3/.wav/.ogg。保持为简短提示音。文件名只能是小写字母、数字和下划线([a-z0-9_])。 - iOS:通过完整文件名(含扩展名)引用,例如
my_notification.caf。扩展名:.caf/.aiff/.wav。最长 30 秒。超过则回退为系统默认声音。
- Android:通过资源名(去掉扩展名的文件名)引用,例如
Social
Read Facebook profile/friends and share to Facebook or Instagram. Facebook results are the raw Graph JSON (no typed model). Instagram callbacks return only an error (none = success).
讀取 Facebook 個人檔案/好友,並分享到 Facebook 或 Instagram。Facebook 的結果為原始的 Graph JSON(沒有型別化模型)。Instagram 的回呼僅傳回一個錯誤(不存在=成功)。
读取 Facebook 资料 / 好友,并分享到 Facebook 或 Instagram。Facebook 结果是原始的 Graph JSON(没有类型化模型)。Instagram 回调仅返回一个错误(不存在 = 成功)。
Get Facebook profile
AndroidiOSReturns the player’s Facebook profile as raw Graph JSON.
以原始 Graph JSON 傳回玩家的 Facebook 個人檔案。
以原始 Graph JSON 形式返回玩家的 Facebook 资料。
PassSDK.Instance.FacebookGetProfile(result =>
{
result.Match(
profile => { /* profile.userId, profile.name, profile.avatarUrl */ },
error => { /* handle failure */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassSocialProfile | The Facebook profile. Fields: PassSocialProfile. |
error | Error | Present on failure: the raw native Facebook error (login or Graph request), or undefined (9000) on an invalid access token. See General error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassSocialProfile | Facebook 個人檔案。欄位:PassSocialProfile。 |
error | Error | 失敗時存在: 原生 Facebook 錯誤(登入或 Graph 請求),或存取權杖無效時為 undefined(9000)。請參閱 一般錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassSocialProfile | Facebook 资料。字段:PassSocialProfile。 |
error | Error | 失败时存在: 原生 Facebook 错误(登录或 Graph 请求),或访问令牌无效时为 undefined(9000)。请参阅 通用错误码。 |
Get Facebook friends
AndroidiOSReturns friends using the app as raw Graph dictionaries.
以原始 Graph 字典傳回正在使用此應用程式的好友。
以原始 Graph 字典形式返回正在使用该应用的好友。
PassSDK.Instance.FacebookGetFriends(0, 50, result =>
{
result.Match(
friends => { foreach (var p in friends.list) { /* p.userId, p.name */ } },
error => { /* handle failure */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
offset | int | Paging offset. |
count | int | Number of friends to fetch. |
| 欄位 | 型別 | 說明 |
|---|---|---|
offset | int | 分頁偏移量。 |
count | int | 要取得的好友數量。 |
| 字段 | 类型 | 描述 |
|---|---|---|
offset | int | 分页偏移量。 |
count | int | 要获取的好友数量。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassSocialFriends | list: PassSocialProfile[]: the player’s Facebook friends. Fields: PassSocialProfile. |
error | Error | Present on failure: the raw native Facebook error (login or Graph request), or cancelLogin (9003) if the player cancels the re-login prompt. See General error codes. Unlike Get Facebook profile, an invalid access token is not mapped to undefined (9000). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassSocialFriends | list:PassSocialProfile[]:玩家的 Facebook 好友。欄位:PassSocialProfile。 |
error | Error | 失敗時存在: 原生 Facebook 錯誤(登入或 Graph 請求),或玩家取消重新登入時為 cancelLogin(9003)。請參閱 一般錯誤碼。與「取得 Facebook 個人檔案」不同,存取權杖無效不會對應為 undefined(9000)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassSocialFriends | list:PassSocialProfile[]:玩家的 Facebook 好友。字段:PassSocialProfile。 |
error | Error | 失败时存在: 原生 Facebook 错误(登录或 Graph 请求),或玩家取消重新登录时为 cancelLogin(9003)。请参阅 通用错误码。与“获取 Facebook 资料”不同,访问令牌无效不会映射为 undefined(9000)。 |
Invite Facebook friends
AndroidiOSOpens the Facebook invite dialog.
開啟 Facebook 邀請對話框。
打开 Facebook 邀请对话框。
PassSDK.Instance.FacebookInviteFriends("Join me!", "Play together", "", 0, result =>
{
result.Match(_ => { /* invite sent */ }, error => { /* canceled/failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
title | string | Dialog title. |
message | string | Invite message shown in the dialog. |
recipients | string | Recipient ids (reserved, not forwarded to native). |
type | int | Invitable-friend filter: 0 = all friends, 1 = app users (friends who use the app), 2 = non-app users. |
| 欄位 | 型別 | 說明 |
|---|---|---|
title | string | 對話框標題。 |
message | string | 在對話框中顯示的邀請訊息。 |
recipients | string | 接收者 id(保留。不會轉發至原生層)。 |
type | int | 可邀請好友篩選: 0 = 所有好友,1 = 使用該應用的好友,2 = 未使用該應用的好友。 |
| 字段 | 类型 | 描述 |
|---|---|---|
title | string | 对话框标题。 |
message | string | 在对话框中显示的邀请消息。 |
recipients | string | 接收者 id(保留。不会转发至原生层)。 |
type | int | 可邀请好友筛选: 0 = 所有好友,1 = 使用该应用的好友,2 = 未使用该应用的好友。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Invite result. |
error | Error | Present on failure: a VGSDK code on a guard or cancel (see Social error codes), otherwise the raw native Facebook error (share/invite dialog or re-auth failure). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 邀請結果。 |
error | Error | 失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 邀请结果。 |
error | Error | 失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。 |
Share photo to Facebook
AndroidiOSShares a photo through the Facebook share dialog.
透過 Facebook 分享對話框分享相片。
通过 Facebook 分享对话框分享一张照片。
PassSDK.Instance.FacebookSharePhoto(imagePathOrBase64, "My caption", result =>
{
result.Match(_ => { /* shared */ }, error => { /* canceled/failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
image | string | Image to share, as a base64-encoded string. |
caption | string | Caption for the shared photo. |
| 欄位 | 型別 | 說明 |
|---|---|---|
image | string | 要分享的圖片,為 base64 編碼字串。 |
caption | string | 所分享相片的說明文字。 |
| 字段 | 类型 | 描述 |
|---|---|---|
image | string | 要分享的图片,为 base64 编码字符串。 |
caption | string | 所分享照片的说明文字。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Share result. |
error | Error | Present on failure: a VGSDK code on a guard or cancel (see Social error codes), otherwise the raw native Facebook error (share/invite dialog or re-auth failure). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 分享結果。 |
error | Error | 失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 分享结果。 |
error | Error | 失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。 |
Share link to Facebook
AndroidiOSShares a link.
分享連結。
分享一个链接。
PassSDK.Instance.FacebookShareLink(
"https://yourgame.com", "Title", "https://yourgame.com/img.png", "Description", result =>
{
result.Match(_ => { /* shared */ }, error => { /* canceled/failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
url | string | Link URL to share. |
title | string | Link title. |
imageUrl | string | Preview image URL. |
des | string | Link description. |
| 欄位 | 型別 | 說明 |
|---|---|---|
url | string | 要分享的連結 URL。 |
title | string | 連結標題。 |
imageUrl | string | 預覽圖片 URL。 |
des | string | 連結描述。 |
| 字段 | 类型 | 描述 |
|---|---|---|
url | string | 要分享的链接 URL。 |
title | string | 链接标题。 |
imageUrl | string | 预览图片 URL。 |
des | string | 链接描述。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Share result. |
error | Error | Present on failure: a VGSDK code on a guard or cancel (see Social error codes), otherwise the raw native Facebook error (share/invite dialog or re-auth failure). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 分享結果。 |
error | Error | 失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 分享结果。 |
error | Error | 失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。 |
Share to Instagram feed
AndroidiOSShares an image to the Instagram feed.
將圖片分享到 Instagram 動態。
将一张图片分享到 Instagram 动态。
PassSDK.Instance.InstagramShareFeed(imagePathOrBase64, result =>
{
result.Match(_ => { /* shared */ }, error => { /* app not installed / failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
image | string | Image to share, as a base64-encoded string. |
| 欄位 | 型別 | 說明 |
|---|---|---|
image | string | 要分享的圖片,為 base64 編碼字串。 |
| 字段 | 类型 | 描述 |
|---|---|---|
image | string | 要分享的图片,为 base64 编码字符串。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Share result. |
error | Error | Present on failure, absent means success: see Social error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 分享結果。 |
error | Error | 失敗時存在。不存在表示成功: 請參閱 社群錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 分享结果。 |
error | Error | 失败时存在。不存在表示成功: 请参阅 社交错误码。 |
Share to Instagram Stories
AndroidiOSShares an image to Instagram Stories.
將圖片分享到 Instagram 限時動態。
将一张图片分享到 Instagram 快拍。
PassSDK.Instance.InstagramShareStories(imagePathOrBase64, result =>
{
result.Match(_ => { /* shared */ }, error => { /* app not installed / failed */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
image | string | Image to share, as a base64-encoded string. |
| 欄位 | 型別 | 說明 |
|---|---|---|
image | string | 要分享的圖片,為 base64 編碼字串。 |
| 字段 | 类型 | 描述 |
|---|---|---|
image | string | 要分享的图片,为 base64 编码字符串。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Share result. |
error | Error | Present on failure, absent means success: see Social error codes. A missing Facebook app id surfaces as facebookConfigNotFound (9020, see General error codes). |
User Experience
Native store rating prompt and in-chat Google Translate.
原生商店評分提示與聊天內的 Google Translate。
原生商店评分提示,以及聊天内的 Google Translate。
Store rating (in-app review)
AndroidiOSTriggers the native in-app review sheet (subject to the OS’s display limits).
觸發原生應用程式內評論表單(受作業系統的顯示限制約束)。
触发原生应用内评价面板(受操作系统的展示限制约束)。
PassSDK.Instance.StoreRating();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Translate text
AndroidiOSTranslates text into a target language via Google Translate. The result is delivered asynchronously.
透過 Google Translate 將文字翻譯為目標語言。結果會以非同步方式傳回。
通过 Google Translate 将文本翻译为目标语言。结果异步返回。
PassSDK.Instance.GoogleTranslate("Hello", "vi", result =>
{
result.Match(
translated => { /* the translated text */ },
error => { /* handle failure */ });
});Input
輸入
输入
| Field | Type | Description |
|---|---|---|
text | string | Text to translate. |
language | string | Target language code (e.g. “vi”). |
| 欄位 | 型別 | 說明 |
|---|---|---|
text | string | 要翻譯的文字。 |
language | string | 目標語言代碼(例如 “vi”)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
text | string | 要翻译的文本。 |
language | string | 目标语言代码(例如 “vi”)。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | The translated text. |
error | Error | Present on failure. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 翻譯後的文字。 |
error | Error | 失敗時存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 翻译后的文本。 |
error | Error | 失败时存在。 |
SDK Information
Read-only accessors for SDK, device, and current-user information: SDK version, active language, detected country, device id, and the signed-in user. All are static accessors. None take input.
用於讀取 SDK、裝置與目前使用者資訊的唯讀存取器: SDK 版本、使用中的語言、偵測到的國家/地區、裝置 ID,以及已登入的使用者。全部皆為靜態存取器。均不需輸入。
SDK、设备与当前用户信息的只读访问器: SDK 版本、当前语言、检测到的国家 / 地区、设备 id 以及已登录的用户。它们都是静态访问器。均不接受输入。
Get current language
AndroidiOSReturns the SDK’s active language code.
傳回 SDK 使用中的語言代碼。
返回 SDK 的当前语言代码。
string language = PassSDK.Instance.GetCurrentLanguage();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Active language code (e.g. “vi”, “en”). |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 使用中的語言代碼(例如 “vi”、“en”)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 当前语言代码(例如 “vi”、“en”)。 |
Get current user
AndroidiOSReturns the signed-in user, or none when no session exists.
傳回已登入的使用者。若不存在工作階段則為無。
返回已登录的用户,若不存在会话则为无。
PassSDK.Instance.GetCurrentUser(result =>
{
result.Match(
user => { /* the signed-in user, or an error when no session */ },
error => { /* no current user */ });
});Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | PassUserInfo | The signed-in user, or absent when no session exists. Fields: PassUserInfo. |
error | Error | Present when no session exists. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | PassUserInfo | 已登入的使用者。沒有工作階段時不存在。欄位詳見 PassUserInfo。 |
error | Error | 沒有工作階段時存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | PassUserInfo | 已登录的用户。没有会话时不存在。字段详见 PassUserInfo。 |
error | Error | 没有会话时存在。 |
Get current country code
AndroidiOSReturns the player’s country code when it is one of the game’s publish-market countries, otherwise returns OT (other).
當玩家的國家/地區屬於遊戲發行市場的國家之一時傳回其代碼。否則傳回 OT(其他)。
当玩家的国家 / 地区代码属于游戏发行市场之一时返回该代码。否则返回 OT(其他)。
string country = PassSDK.Instance.GetCountry();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | The player’s country code, or OT (other) when outside the game’s publish market. Absent when not yet detected. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 玩家的國家/地區代碼。位於遊戲發行市場之外時為 OT(其他)。尚未偵測到時不存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 玩家的国家 / 地区代码。位于游戏发行市场之外时为 OT(其他)。尚未检测到时不存在。 |
Get device id
AndroidiOSReturns a per-device identifier: the advertising id when available, otherwise a fallback device id: used when the advertising id is unavailable or all-zero (e.g. tracking not authorized). Dashes are replaced with underscores.
傳回每台裝置的識別碼:可用時為廣告識別碼,否則為備用裝置識別碼: 於廣告識別碼無法使用或全為零時使用(例如未授權追蹤)。連字號會以底線取代。
返回每设备标识符:可用时为广告标识符,否则为备用设备标识符: 在广告标识符不可用或全为零时使用(例如未授权跟踪)。连字符会被替换为下划线。
string deviceId = PassSDK.Instance.GetDeviceId();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
value | string | Advertising id when available, otherwise a fallback device id, with dashes replaced by underscores. Absent when unavailable. |
| 欄位 | 型別 | 說明 |
|---|---|---|
value | string | 可用時為廣告識別碼。否則為備用裝置識別碼,連字號會以底線取代。無法取得時不存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
value | string | 可用时为广告标识符。否则为备用设备标识符,连字符会替换为下划线。无法获取时不存在。 |
Data Models
Shared objects and enums referenced by multiple methods, documented once here. For enums, each row is one case: Field = the case, Type = its raw value.
由多個方法參考的共用物件與列舉,於此處統一說明一次。對於列舉,每一列代表一個 case: Field=該 case,Type=其原始值。
被多个方法引用的共享对象与枚举,在此统一记录一次。对于枚举,每一行是一个枚举项: Field = 该枚举项,Type = 其原始值。
PassUserInfo
The signed-in player, delivered by every login callback and by the current-user accessor.
由每個登入回呼以及目前使用者存取器傳回的使用者物件。
由每个登录回调以及当前用户访问器返回的用户对象。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
UserId | string | Unique VNGGames user id. |
DisplayName | string | Player display name. |
SessionId | string | Session token used to authenticate backend calls. |
LoginChannel | LoginChannel | Login channel: see LoginChannel. |
LoginChannelString | string | The login channel as a string. |
ProtectedStatus | bool | Whether the account is protected/secured. |
LastUpdateSession | double | Epoch seconds of the last session refresh. |
| 欄位 | 型別 | 說明 |
|---|---|---|
UserId | string | VNGGames 唯一使用者 ID。 |
DisplayName | string | 玩家顯示名稱。 |
SessionId | string | 用於驗證後端呼叫的工作階段權杖。 |
LoginChannel | LoginChannel | 登入頻道: 請參閱 LoginChannel。 |
LoginChannelString | string | 以字串表示的登入頻道。 |
ProtectedStatus | bool | 帳號是否受保護/已加固。 |
LastUpdateSession | double | 上次工作階段重新整理的 Epoch 秒數。 |
| 字段 | 类型 | 描述 |
|---|---|---|
UserId | string | 唯一的 VNGGames 用户 id。 |
DisplayName | string | 玩家显示名称。 |
SessionId | string | 用于验证后端调用的会话令牌。 |
LoginChannel | LoginChannel | 登录渠道: 请参阅 LoginChannel。 |
LoginChannelString | string | 以字符串表示的登录渠道。 |
ProtectedStatus | bool | 账号是否受保护 / 已加固。 |
LastUpdateSession | double | 最近一次会话刷新的 Unix 时间戳(秒)。 |
LoginChannel
Login channel identifier (int enum): selects the channel for Direct login and reports which channel a player signed in with. Supported channels:
登入頻道識別碼(int 列舉): 用於為 Direct login 選擇頻道,並回報玩家使用哪個頻道登入。支援的頻道:
登录渠道标识符(int 枚举): 为 Direct login 选择渠道,并报告玩家使用哪个渠道登录。支持的渠道:
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
Facebook | 1 | Facebook. |
Google | 3 | Google. |
ZingID | 4 | Zing ID. |
Guest | 5 | Anonymous guest. |
Apple | 7 | Sign in with Apple. |
Email | 8 | Email. |
| 欄位 | 型別 | 說明 |
|---|---|---|
Facebook | 1 | Facebook。 |
Google | 3 | Google。 |
ZingID | 4 | Zing ID。 |
Guest | 5 | 匿名訪客。 |
Apple | 7 | 使用 Apple 登入。 |
Email | 8 | 電子郵件。 |
| 字段 | 类型 | 描述 |
|---|---|---|
Facebook | 1 | Facebook。 |
Google | 3 | Google。 |
ZingID | 4 | Zing ID。 |
Guest | 5 | 匿名访客。 |
Apple | 7 | Sign in with Apple。 |
Email | 8 | 电子邮箱。 |
VGSDKManageAccountAction
The action the player took on the account-management screen (int enum), delivered on VGSDKManageAccount.Action.
玩家在帳號管理畫面上採取的動作(int 列舉),透過 VGSDKManageAccount.Action 傳回。
玩家在账号管理界面上采取的操作(int 枚举),通过 VGSDKManageAccount.Action 返回。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
Unknown | -1 | Unknown / no action. |
Closed | 0 | Closed the screen without acting. |
AccountBound | 1 | Bound / linked an account. |
AccountSwitched | 2 | Switched to another account. |
AccountDeleted | 3 | Chose to delete the account. |
| 欄位 | 型別 | 說明 |
|---|---|---|
Unknown | -1 | 未知/無動作。 |
Closed | 0 | 未執行任何操作即關閉畫面。 |
AccountBound | 1 | 綁定/連結了帳號。 |
AccountSwitched | 2 | 切換到另一個帳號。 |
AccountDeleted | 3 | 選擇刪除帳號。 |
| 字段 | 类型 | 描述 |
|---|---|---|
Unknown | -1 | 未知/无操作。 |
Closed | 0 | 未执行任何操作即关闭屏幕。 |
AccountBound | 1 | 绑定/关联了账号。 |
AccountSwitched | 2 | 切换到另一个账号。 |
AccountDeleted | 3 | 选择删除账号。 |
RewardedVideoStatus
ironSource rewarded-video ad/reward lifecycle event (Int enum), delivered on PassISRewardVideo.RewardedVideoStatus.
ironSource 獎勵影片廣告/獎勵生命週期事件(Int 列舉),透過 PassISRewardVideo.RewardedVideoStatus 傳回。
ironSource 激励视频广告/奖励生命周期事件(Int 枚举),通过 PassISRewardVideo.RewardedVideoStatus 返回。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
adAvailable | 0 | An ad is available. |
adUnavailable | 1 | No ad available. |
adOpened | 2 | Ad opened. |
adShowFailed | 3 | Ad failed to show: carries the underlying ironSource error (its native code, not a VGSDK code). |
adClicked | 4 | Ad clicked. |
adRewarded | 5 | Reward earned: grant it here. |
adClosed | 6 | Ad closed. |
onComplete | 7 | The rewarded-video operation completed. |
| 欄位 | 型別 | 說明 |
|---|---|---|
adAvailable | 0 | 有可用的廣告。 |
adUnavailable | 1 | 沒有可用的廣告。 |
adOpened | 2 | 廣告已開啟。 |
adShowFailed | 3 | 廣告顯示失敗: 帶有底層的 ironSource 錯誤(其原生代碼,非 VGSDK 代碼)。 |
adClicked | 4 | 廣告被點擊。 |
adRewarded | 5 | 獲得的獎勵: 在此發放。 |
adClosed | 6 | 廣告已關閉。 |
onComplete | 7 | 獎勵影片操作已完成。 |
| 字段 | 类型 | 描述 |
|---|---|---|
adAvailable | 0 | 有可用的广告。 |
adUnavailable | 1 | 没有可用的广告。 |
adOpened | 2 | 广告已打开。 |
adShowFailed | 3 | 广告展示失败: 携带底层的 ironSource 错误(其原生代码,非 VGSDK 代码)。 |
adClicked | 4 | 广告被点击。 |
adRewarded | 5 | 获得的奖励: 在此发放。 |
adClosed | 6 | 广告已关闭。 |
onComplete | 7 | 激励视频操作已完成。 |
VGSDKMetaAdsInterstitialStatus
Meta Audience Network interstitial ad event (Int enum), delivered on VGSDKMetaAdsInterstitialListener.Status.
Meta Audience Network 插頁式廣告事件(Int 列舉),透過 VGSDKMetaAdsInterstitialListener.Status 傳回。
Meta Audience Network 插屏广告事件(Int 枚举),通过 VGSDKMetaAdsInterstitialListener.Status 返回。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
InterstitialDisplayed | 0 | Ad opened. |
InterstitialDismissed | 1 | Ad closed. |
AdLoaded | 2 | Ad loaded. |
AdClicked | 3 | Ad clicked. |
LoggingImpression | 4 | Impression logged. |
InterstitialWillDismissed | 5 | About to close. |
| 欄位 | 型別 | 說明 |
|---|---|---|
InterstitialDisplayed | 0 | 廣告已開啟。 |
InterstitialDismissed | 1 | 廣告已關閉。 |
AdLoaded | 2 | 廣告已載入。 |
AdClicked | 3 | 廣告被點擊。 |
LoggingImpression | 4 | 已記錄曝光。 |
InterstitialWillDismissed | 5 | 即將關閉。 |
| 字段 | 类型 | 描述 |
|---|---|---|
InterstitialDisplayed | 0 | 广告已打开。 |
InterstitialDismissed | 1 | 广告已关闭。 |
AdLoaded | 2 | 广告已加载。 |
AdClicked | 3 | 广告被点击。 |
LoggingImpression | 4 | 已记录曝光。 |
InterstitialWillDismissed | 5 | 即将关闭。 |
VGSDKMetaAdsRewardedVideoStatus
Meta Audience Network rewarded-video ad event (Int enum), delivered on VGSDKMetaAdsRewardedVideoListener.Status.
Meta Audience Network 獎勵影片廣告事件(Int 列舉),透過 VGSDKMetaAdsRewardedVideoListener.Status 傳回。
Meta Audience Network 激励视频广告事件(Int 枚举),通过 VGSDKMetaAdsRewardedVideoListener.Status 返回。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
RewardServerSuccess | 0 | The reward server confirmed the reward. |
AdLoaded | 1 | Ad loaded. |
AdClicked | 2 | Ad clicked. |
LoggingImpression | 3 | Impression logged. |
RewardedVideoActivityDestroyed | 4 | The ad activity was destroyed. |
RewardedVideoClosed | 5 | Ad closed. |
RewardedVideoCompleted | 6 | The rewarded video finished. |
| 欄位 | 型別 | 說明 |
|---|---|---|
RewardServerSuccess | 0 | 獎勵伺服器已確認獎勵。 |
AdLoaded | 1 | 廣告已載入。 |
AdClicked | 2 | 廣告被點擊。 |
LoggingImpression | 3 | 已記錄曝光。 |
RewardedVideoActivityDestroyed | 4 | 廣告 activity 已銷毀。 |
RewardedVideoClosed | 5 | 廣告已關閉。 |
RewardedVideoCompleted | 6 | 獎勵影片已結束。 |
| 字段 | 类型 | 描述 |
|---|---|---|
RewardServerSuccess | 0 | 奖励服务器已确认奖励。 |
AdLoaded | 1 | 广告已加载。 |
AdClicked | 2 | 广告被点击。 |
LoggingImpression | 3 | 已记录曝光。 |
RewardedVideoActivityDestroyed | 4 | 广告 activity 已销毁。 |
RewardedVideoClosed | 5 | 广告已关闭。 |
RewardedVideoCompleted | 6 | 激励视频已结束。 |
VGSDKMetaAdsRewardedInterstitialStatus
Meta Audience Network rewarded-interstitial ad event (Int enum), delivered on VGSDKMetaAdsRewardedInterstitialListener.Status.
Meta Audience Network 獎勵插頁式廣告事件(Int 列舉),透過 VGSDKMetaAdsRewardedInterstitialListener.Status 傳回。
Meta Audience Network 激励插屏广告事件(Int 枚举),通过 VGSDKMetaAdsRewardedInterstitialListener.Status 返回。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
RewardServerSuccess | 0 | The reward server confirmed the reward. |
AdLoaded | 1 | Ad loaded. |
AdClicked | 2 | Ad clicked. |
LoggingImpression | 3 | Impression logged. |
RewardedInterstitialClosed | 4 | Ad closed. |
RewardedInterstitialCompleted | 5 | The rewarded interstitial finished. |
RewardedInterstitialWillClosed | 6 | About to close. |
| 欄位 | 型別 | 說明 |
|---|---|---|
RewardServerSuccess | 0 | 獎勵伺服器已確認獎勵。 |
AdLoaded | 1 | 廣告已載入。 |
AdClicked | 2 | 廣告被點擊。 |
LoggingImpression | 3 | 已記錄曝光。 |
RewardedInterstitialClosed | 4 | 廣告已關閉。 |
RewardedInterstitialCompleted | 5 | 獎勵插頁式廣告已結束。 |
RewardedInterstitialWillClosed | 6 | 即將關閉。 |
| 字段 | 类型 | 描述 |
|---|---|---|
RewardServerSuccess | 0 | 奖励服务器已确认奖励。 |
AdLoaded | 1 | 广告已加载。 |
AdClicked | 2 | 广告被点击。 |
LoggingImpression | 3 | 已记录曝光。 |
RewardedInterstitialClosed | 4 | 广告已关闭。 |
RewardedInterstitialCompleted | 5 | 激励插屏广告已结束。 |
RewardedInterstitialWillClosed | 6 | 即将关闭。 |
VGSDKPaymentProduct
A sellable product returned by Get products.
由「取得商品」傳回的可販售商品。
由“获取商品”返回的可售卖商品。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
ItemId | string | The configured item id from Store. |
Price | double | Numeric price in the store currency. |
PriceMicros | ulong | Price in micro-units: 1,000,000 = one currency unit. |
DisplayPrice | string | Store-formatted price string to show the player. |
Currency | string | ISO currency code. |
CurrencySymbol | string | Currency symbol for the price. |
| 欄位 | 型別 | 說明 |
|---|---|---|
ItemId | string | 在商店設定的商品 id。 |
Price | double | 以商店貨幣計價的數值價格。 |
PriceMicros | ulong | 以微單位表示的價格: 1,000,000 = 一個 currency 單位。 |
DisplayPrice | string | 商店格式化後、用於向玩家顯示的價格字串。 |
Currency | string | ISO 貨幣代碼。 |
CurrencySymbol | string | 價格所用的貨幣符號。 |
| 字段 | 类型 | 描述 |
|---|---|---|
ItemId | string | 在商店配置的商品 id。 |
Price | double | 以商店货币计价的数值价格。 |
PriceMicros | ulong | 以微单位表示的价格: 1,000,000 = 一个 currency 单位。 |
DisplayPrice | string | 商店格式化后、用于向玩家展示的价格字符串。 |
Currency | string | ISO 货币代码。 |
CurrencySymbol | string | 价格所用的货币符号。 |
VGSDKAnalyticsProvider
Analytics provider selector for sendCustomEvent (Int enum).
sendCustomEvent 的分析供應商選擇器(Int 列舉)。
sendCustomEvent 的分析提供方选择器(Int 枚举)。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
.appsFlyer | 0 | AppsFlyer. |
.firebase | 1 | Firebase Analytics. |
.dataPlatform | 2 | VNGGames Data Platform. |
.facebook | 3 | Facebook App Events. |
.thinkingData | 4 | ThinkingData. |
.cleverTap | 5 | CleverTap. |
| 欄位 | 型別 | 說明 |
|---|---|---|
.appsFlyer | 0 | AppsFlyer。 |
.firebase | 1 | Firebase Analytics。 |
.dataPlatform | 2 | VNGGames Data Platform。 |
.facebook | 3 | Facebook App Events。 |
.thinkingData | 4 | ThinkingData。 |
.cleverTap | 5 | CleverTap。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.appsFlyer | 0 | AppsFlyer。 |
.firebase | 1 | Firebase Analytics。 |
.dataPlatform | 2 | VNGGames 数据平台。 |
.facebook | 3 | Facebook App Events。 |
.thinkingData | 4 | ThinkingData。 |
.cleverTap | 5 | CleverTap。 |
Analytics default parameters
The default parameters the analytics facade merges into every event it triggers. The SDK fills them automatically: you never set them, and each method’s own inputs and any extraData you pass are added on top. device_info, user_info, response_info, and login_info are JSON-encoded strings. The last two are conditional: see their rows. Used by every method in Analytics.
分析門面合併到它所觸發之每個事件的預設參數。SDK 會自動填入: 你永遠不需設定。每個方法自身的輸入以及你傳入的任何 extraData 會再疊加於其上。device_info、user_info、response_info 與 login_info 為 JSON 編碼字串。後兩者為條件性: 請參閱其對應列。由 分析 中的每個方法使用。
分析门面合并到它触发的每个事件中的默认参数。SDK 会自动填充它们: 你无需设置。每个方法自身的输入以及你传入的任何 extraData 都会叠加在其之上。device_info、user_info、response_info 和 login_info 是 JSON 编码的字符串。后两个是条件性的: 见其对应行。分析 中的每个方法都会使用它们。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
device_info | String | Device info, JSON-encoded: os (the platform name), version (OS version), model (device model). |
device_id | String | Per-device id (advertising id when available, otherwise a fallback device id, prefixed). |
game_version | String | Full game (app) version. |
sdk_version | String | VNGGames SDK version. |
package | String | Game bundle id / package name. |
network_type | String | Active network type at send time. |
timestamp | String | Event time, in milliseconds. |
session_id | String | Analytics session id: a UUID generated once per app run. |
user_info | String | Signed-in user info, JSON-encoded: user_id, social_id, country_code. Ids are empty while signed out. |
appsflyer_id | String | AppsFlyer device UID. |
frb_installation_id | String | Firebase installation id. |
frb_app_instance_id | String | Firebase app-instance id. |
response_info | String | Added only on events that report an outcome. JSON-encoded: status (Success / Failed / Canceled), error_code, remote (0 local, 1 remote). |
login_info | String | Added only on login-flow events. JSON-encoded: method, channel, flow (CreateUser / UpdateUser), step. |
| 欄位 | 型別 | 說明 |
|---|---|---|
device_info | String | 裝置資訊,JSON 編碼:os(平台名稱)、version(作業系統版本)、model(裝置型號)。 |
device_id | String | 每台裝置的 ID(可用時為廣告 ID,否則為備用裝置 ID。含前綴)。 |
game_version | String | 完整的遊戲(應用程式)版本。 |
sdk_version | String | VNGGames SDK 版本。 |
package | String | 遊戲的 bundle id/套件名稱。 |
network_type | String | 傳送當下使用中的網路類型。 |
timestamp | String | 事件時間,以毫秒為單位。 |
session_id | String | 分析工作階段 ID: 每次應用程式執行時產生一次的 UUID。 |
user_info | String | 已登入使用者資訊,JSON 編碼:user_id、social_id、country_code。登出時這些 ID 為空。 |
appsflyer_id | String | AppsFlyer 裝置 UID。 |
frb_installation_id | String | Firebase 安裝 ID。 |
frb_app_instance_id | String | Firebase 應用程式執行個體 ID。 |
response_info | String | 僅在回報結果的事件上加入。JSON 編碼:status(Success/Failed/Canceled)、error_code、remote(0 本機、1 遠端)。 |
login_info | String | 僅在登入流程事件上加入。JSON 編碼:method、channel、flow(CreateUser/UpdateUser)、step。 |
| 字段 | 类型 | 描述 |
|---|---|---|
device_info | String | 设备信息,JSON 编码:os(平台名称)、version(操作系统版本)、model(设备型号)。 |
device_id | String | 每设备 id(可用时为广告 id,否则为备用设备 id。带前缀)。 |
game_version | String | 完整的游戏(应用)版本。 |
sdk_version | String | VNGGames SDK 版本。 |
package | String | 游戏 bundle id / 包名。 |
network_type | String | 发送时的当前网络类型。 |
timestamp | String | 事件时间,以毫秒为单位。 |
session_id | String | 分析会话 id: 每次应用运行生成一次的 UUID。 |
user_info | String | 已登录用户信息,JSON 编码:user_id、social_id、country_code。未登录时这些 id 为空。 |
appsflyer_id | String | AppsFlyer 设备 UID。 |
frb_installation_id | String | Firebase 安装 id。 |
frb_app_instance_id | String | Firebase 应用实例 id。 |
response_info | String | 仅在报告结果的事件上添加。JSON 编码:status(Success / Failed / Canceled)、error_code、remote(0 本地,1 远程)。 |
login_info | String | 仅在登录流程事件上添加。JSON 编码:method、channel、flow(CreateUser / UpdateUser)、step。 |
Analytics platform prefixes
The per-provider prefix the VNGGames SDK inserts into every event it triggers: each event reaches its provider as vgsdk_{prefix}_{event name} (for example, vgsdk_af_app_open). Used by every method in Analytics.
VNGGames SDK 插入到它所觸發之每個事件中的各供應商前綴: 每個事件會以 vgsdk_{prefix}_{event name} 抵達其供應商(例如 vgsdk_af_app_open)。由 分析 中的每個方法使用。
VNGGames SDK 插入到它触发的每个事件中的每提供方前缀: 每个事件以 vgsdk_{prefix}_{event name} 形式到达其提供方(例如 vgsdk_af_app_open)。分析 中的每个方法都会使用它。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
Firebase | frb | Firebase Analytics. |
Facebook | fb | Facebook App Events. |
AppsFlyer | af | AppsFlyer. |
Data Platform | dp | VNGGames Data Platform. |
CleverTap | clt | CleverTap. |
ThinkingData | td | ThinkingData. |
| 欄位 | 型別 | 說明 |
|---|---|---|
Firebase | frb | Firebase Analytics。 |
Facebook | fb | Facebook App Events。 |
AppsFlyer | af | AppsFlyer。 |
Data Platform | dp | VNGGames Data Platform。 |
CleverTap | clt | CleverTap。 |
ThinkingData | td | ThinkingData。 |
| 字段 | 类型 | 描述 |
|---|---|---|
Firebase | frb | Firebase Analytics。 |
Facebook | fb | Facebook App Events。 |
AppsFlyer | af | AppsFlyer。 |
Data Platform | dp | VNGGames 数据平台。 |
CleverTap | clt | CleverTap。 |
ThinkingData | td | ThinkingData。 |
Ad revenue mediation network
Mediation network for ad-revenue reporting (UInt enum), used by miscAdRevenue.
用於廣告收益回報的中介聯播網(UInt 列舉),由 miscAdRevenue 使用。
用于广告收入上报的聚合网络(UInt 枚举),由 miscAdRevenue 使用。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
.googleAdMob | 1 | Google AdMob. |
.ironSource | 2 | ironSource. |
.applovinMax | 3 | AppLovin MAX. |
.fyber | 4 | Fyber. |
.appodeal | 5 | Appodeal. |
.admost | 6 | Admost. |
.topon | 7 | TopOn. |
.tradplus | 8 | TradPlus. |
.yandex | 9 | Yandex. |
.chartBoost | 10 | Chartboost. |
.unity | 11 | Unity Ads. |
.custom | 12 | Custom. |
.directMonetization | 13 | Direct monetization. |
| 欄位 | 型別 | 說明 |
|---|---|---|
.googleAdMob | 1 | Google AdMob。 |
.ironSource | 2 | ironSource。 |
.applovinMax | 3 | AppLovin MAX。 |
.fyber | 4 | Fyber。 |
.appodeal | 5 | Appodeal。 |
.admost | 6 | Admost。 |
.topon | 7 | TopOn。 |
.tradplus | 8 | TradPlus。 |
.yandex | 9 | Yandex。 |
.chartBoost | 10 | Chartboost。 |
.unity | 11 | Unity Ads。 |
.custom | 12 | 自訂。 |
.directMonetization | 13 | 直接營利。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.googleAdMob | 1 | Google AdMob。 |
.ironSource | 2 | ironSource。 |
.applovinMax | 3 | AppLovin MAX。 |
.fyber | 4 | Fyber。 |
.appodeal | 5 | Appodeal。 |
.admost | 6 | Admost。 |
.topon | 7 | TopOn。 |
.tradplus | 8 | TradPlus。 |
.yandex | 9 | Yandex。 |
.chartBoost | 10 | Chartboost。 |
.unity | 11 | Unity Ads。 |
.custom | 12 | 自定义。 |
.directMonetization | 13 | 直接变现。 |
PassSocialProfile
A social profile returned by the Facebook profile/friends methods.
由 Facebook 個人檔案/好友方法傳回的社群個人檔案。
由 Facebook 资料/好友方法返回的社交资料。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
userId | string | VNGGames/Facebook user id. |
name | string | Display name. |
avatarUrl | string | Profile picture URL. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userId | string | VNGGames/Facebook 使用者 id。 |
name | string | 顯示名稱。 |
avatarUrl | string | 個人檔案圖片 URL。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userId | string | VNGGames/Facebook 用户 id。 |
name | string | 显示名称。 |
avatarUrl | string | 头像图片 URL。 |
Error Codes
Failures arrive as an error on domain net.vnggames.sdk (PassError), banded by source. Each row is one code: Field = numeric error.code, Type = the symbol. Note: for the mapped auth/payment bands the SDK band number is shown in the message while error.code preserves the upstream server value.
失敗會以網域 net.vnggames.sdk 上的錯誤(PassError)傳回,並依來源分段。每一列代表一個錯誤碼: Field=數值 error.code,Type=該符號。注意:對於已對應的驗證/付款分段,訊息中會顯示 SDK 分段編號,而 error.code 則保留上游伺服器的值。
失败以域为 net.vnggames.sdk(PassError)的错误形式返回,按来源分段。每一行是一个错误码: Field = 数值 error.code,Type = 符号。注意:对于经过映射的验证 / 支付段,消息中显示的是 SDK 段号,而 error.code 保留上游服务器的原始值。
Auth: VGA / OAuth (7xxx)
VGA (VNGGames Account) / OAuth login errors, delivered as an error. These back the VGA login flows. iOS/Android differ: both share the 7005 to 7020 OAuth codes, but elsewhere the endpoints diverge: on Android user-cancel is 7002 (USER_CANCEL, the legacy build flavor reports 9003 on its cancel-login path), 7003 is LOGIN_FAILED, and 7021 is account-already-bound (QUICK_LOGIN_ACCOUNT_BOUND). iOS instead uses 7001 for cancel and 7021 for validateAccessTokenNullResult, and defines 7022 至 7027 (null-result and quick-login cases) that Android does not.
VGA(VNGGames Account)/OAuth 登入錯誤,以錯誤傳回。這些支撐 VGA 登入流程。iOS 與 Android 有差異:兩者共用 7005 至 7020 的 OAuth 代碼,但其他端點有所分歧: 在 Android 上,玩家取消為 7002(USER_CANCEL,legacy 建置風味在其取消登入路徑回報 9003),7003 為 LOGIN_FAILED,而 7021 為帳號已綁定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 則以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,並定義了 Android 沒有的 7022 至 7027(未傳回結果與快速登入的情形)。
VGA(VNGGames Account)/ OAuth 登录错误,以错误形式返回。它们支撑 VGA 登录流程。iOS 与 Android 存在差异:两者共用 7005 至 7020 的 OAuth 代码,但其他端点有所分歧: 在 Android 上,玩家取消为 7002(USER_CANCEL,legacy 构建风味在其取消登录路径返回 9003),7003 为 LOGIN_FAILED,而 7021 为账号已绑定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 则以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,并定义了 Android 没有的 7022 至 7027(未返回结果与快速登录的情形)。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
7000 | undefined | Unmapped GGID / OAuth error (fallback). |
7001 | cancelLogin | Player canceled login. |
7005 | invalidRequest | OAuth invalid_request. |
7006 | invalidClient | OAuth invalid_client. |
7007 | invalidGrant | OAuth invalid_grant. |
7008 | invalidScope | OAuth invalid_scope. |
7009 | unsupportedResponseType | OAuth unsupported_response_type. |
7010 | unsupportedGrantType | OAuth unsupported_grant_type. |
7011 | unauthorizedClient | OAuth unauthorized_client. |
7012 | unauthorizedCode | OAuth unauthorized_code. |
7013 | unauthorizedToken | OAuth unauthorized_token. |
7014 | expiredAccessToken | Access token expired. |
7015 | expiredRefreshToken | Refresh token expired. |
7016 | inactiveAccessToken | Access token inactive. |
7017 | accessDenied | Access denied. |
7018 | serverError | OAuth server_error. |
7019 | internalError | OAuth internal_error. |
7020 | invalidUserCredentials | Invalid user credentials. |
7021 | validateAccessTokenNullResult | iOS: token validation returned no result. On Android, 7021 is QUICK_LOGIN_ACCOUNT_BOUND (see the platform note above). |
7022 | refreshAccessTokenNullResult | Token refresh returned no result. |
7023 | getProfileNullResult | Profile fetch returned no result. |
7024 | authenticateNullResult | Authentication returned no result. |
7025 | quickLoginAccountBound | iOS only: the guest account is already bound to a VGA account. Android maps this case to 7021. |
7026 | quickLoginRequiredBinding | Binding is required: the user must bind their account (no skip option). |
7027 | quickLoginTurnOff | Quick login is disabled. The standard login options are shown instead. |
| 欄位 | 型別 | 說明 |
|---|---|---|
7000 | undefined | 未對應的 GGID/OAuth 錯誤(備用)。 |
7001 | cancelLogin | 玩家取消登入。 |
7005 | invalidRequest | OAuth invalid_request。 |
7006 | invalidClient | OAuth invalid_client。 |
7007 | invalidGrant | OAuth invalid_grant。 |
7008 | invalidScope | OAuth invalid_scope。 |
7009 | unsupportedResponseType | OAuth unsupported_response_type。 |
7010 | unsupportedGrantType | OAuth unsupported_grant_type。 |
7011 | unauthorizedClient | OAuth unauthorized_client。 |
7012 | unauthorizedCode | OAuth unauthorized_code。 |
7013 | unauthorizedToken | OAuth unauthorized_token。 |
7014 | expiredAccessToken | 存取權杖已過期。 |
7015 | expiredRefreshToken | 重新整理權杖已過期。 |
7016 | inactiveAccessToken | 存取權杖未啟用。 |
7017 | accessDenied | 存取遭拒。 |
7018 | serverError | OAuth server_error。 |
7019 | internalError | OAuth internal_error。 |
7020 | invalidUserCredentials | 使用者憑證無效。 |
7021 | validateAccessTokenNullResult | iOS: 權杖驗證未傳回任何結果。在 Android 上,7021 為 QUICK_LOGIN_ACCOUNT_BOUND(見上方平台說明)。 |
7022 | refreshAccessTokenNullResult | 權杖重新整理未傳回任何結果。 |
7023 | getProfileNullResult | 個人檔案取得未傳回任何結果。 |
7024 | authenticateNullResult | 身分驗證未傳回任何結果。 |
7025 | quickLoginAccountBound | 僅 iOS: 此訪客帳號已綁定到某個 VGA 帳號。Android 將此情形對應為 7021。 |
7026 | quickLoginRequiredBinding | 必須綁定: 使用者必須綁定其帳號(無略過選項)。 |
7027 | quickLoginTurnOff | 快速登入已停用。改為顯示標準登入選項。 |
| 字段 | 类型 | 描述 |
|---|---|---|
7000 | undefined | 未映射的 GGID / OAuth 错误(兜底)。 |
7001 | cancelLogin | 玩家取消了登录。 |
7005 | invalidRequest | OAuth invalid_request 错误。 |
7006 | invalidClient | OAuth invalid_client 错误。 |
7007 | invalidGrant | OAuth invalid_grant 错误。 |
7008 | invalidScope | OAuth invalid_scope 错误。 |
7009 | unsupportedResponseType | OAuth unsupported_response_type 错误。 |
7010 | unsupportedGrantType | OAuth unsupported_grant_type 错误。 |
7011 | unauthorizedClient | OAuth unauthorized_client 错误。 |
7012 | unauthorizedCode | OAuth unauthorized_code 错误。 |
7013 | unauthorizedToken | OAuth unauthorized_token 错误。 |
7014 | expiredAccessToken | 访问令牌已过期。 |
7015 | expiredRefreshToken | 刷新令牌已过期。 |
7016 | inactiveAccessToken | 访问令牌未激活。 |
7017 | accessDenied | 访问被拒绝。 |
7018 | serverError | OAuth server_error。 |
7019 | internalError | OAuth internal_error。 |
7020 | invalidUserCredentials | 用户凭据无效。 |
7021 | validateAccessTokenNullResult | iOS: 令牌验证未返回结果。在 Android 上,7021 为 QUICK_LOGIN_ACCOUNT_BOUND(见上方平台说明)。 |
7022 | refreshAccessTokenNullResult | 令牌刷新未返回结果。 |
7023 | getProfileNullResult | 资料获取未返回结果。 |
7024 | authenticateNullResult | 身份验证未返回结果。 |
7025 | quickLoginAccountBound | 仅 iOS: 该访客账号已绑定到某个 VGA 账号。Android 将此情形映射为 7021。 |
7026 | quickLoginRequiredBinding | 必须绑定: 用户必须绑定其账号(无跳过选项)。 |
7027 | quickLoginTurnOff | 快速登录已禁用。改为显示标准登录选项。 |
Auth: Passport legacy (8xxx)
Passport-legacy login errors. The SDK maps each Passport server return code to an 8xxx value (8000 = unknown fallback). error.code carries the 8xxx band while the original server code is in the message. Type = the source Passport server return code.
Passport legacy 登入錯誤。SDK 會將每個 Passport 伺服器回傳碼對應到一個 8xxx 值(8000=未知備用)。error.code 帶有 8xxx 分段,而原始伺服器碼則在訊息中。Type=來源 Passport 伺服器回傳碼。
Passport 旧版登录错误。SDK 将每个 Passport 服务器返回码映射为一个 8xxx 值(8000 = 未知兜底)。error.code 携带 8xxx 段,而原始服务器码在消息中。Type = 来源 Passport 服务器返回码。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
8000 | unknown | Unknown Passport-legacy login error (fallback). |
8001 | 1 | Success (server returned code 1). |
8002 | -500 | System error: inspect server logs. |
8003 | -404 | Invalid request (client called the wrong URL). |
8004 | -1 | Bad signature. |
8005 | -2 | Bad request parameters. |
8006 | -101 | Email is already registered. |
8007 | -102 | Email already in use (guest protection). |
8008 | -103 | Email does not exist (forgot / reset password). |
8009 | -104 | UserID is already protected. |
8010 | -105 | UserID not found (account disabled / deleted). |
8011 | -106 | Invalid login credentials. |
8012 | -107 | Invalid login credentials (profile mismatch / null). |
8013 | -108 | Invalid or expired session. |
8014 | -109 | Under the minimum age allowed to play. |
8015 | -110 | Account initialization failed. |
8016 | -111 | User is not in the early-access allow list. |
8017 | -112 | Account is locked. |
8018 | -113 | Account profile is incomplete. |
| 欄位 | 型別 | 說明 |
|---|---|---|
8000 | unknown | 未知的 Passport legacy 登入錯誤(備用)。 |
8001 | 1 | 成功(伺服器回傳碼 1)。 |
8002 | -500 | 系統錯誤: 請檢查伺服器記錄。 |
8003 | -404 | 無效的請求(用戶端呼叫了錯誤的 URL)。 |
8004 | -1 | 簽章錯誤。 |
8005 | -2 | 請求參數錯誤。 |
8006 | -101 | 電子郵件已註冊。 |
8007 | -102 | 電子郵件已被使用(訪客保護)。 |
8008 | -103 | 電子郵件不存在(忘記/重設密碼)。 |
8009 | -104 | UserID 已受保護。 |
8010 | -105 | 找不到 UserID(帳號已停用/已刪除)。 |
8011 | -106 | 登入憑證無效。 |
8012 | -107 | 登入憑證無效(個人檔案不符/為 null)。 |
8013 | -108 | 工作階段無效或已過期。 |
8014 | -109 | 未達允許遊玩的最低年齡。 |
8015 | -110 | 帳號初始化失敗。 |
8016 | -111 | 使用者不在搶先體驗的允許清單中。 |
8017 | -112 | 帳號已鎖定。 |
8018 | -113 | 帳號個人檔案不完整。 |
| 字段 | 类型 | 描述 |
|---|---|---|
8000 | unknown | 未知的 Passport 旧版登录错误(兜底)。 |
8001 | 1 | 成功(服务器返回码 1)。 |
8002 | -500 | 系统错误: 请检查服务器日志。 |
8003 | -404 | 请求无效(客户端调用了错误的 URL)。 |
8004 | -1 | 签名错误。 |
8005 | -2 | 请求参数错误。 |
8006 | -101 | 邮箱已被注册。 |
8007 | -102 | 邮箱已被使用(访客保护)。 |
8008 | -103 | 邮箱不存在(忘记 / 重置密码)。 |
8009 | -104 | UserID 已受保护。 |
8010 | -105 | 找不到 UserID(账号已禁用 / 删除)。 |
8011 | -106 | 登录凭据无效。 |
8012 | -107 | 登录凭据无效(资料不匹配 / 为空)。 |
8013 | -108 | 会话无效或已过期。 |
8014 | -109 | 未达到允许游玩的最低年龄。 |
8015 | -110 | 账号初始化失败。 |
8016 | -111 | 用户不在抢先体验白名单中。 |
8017 | -112 | 账号已被锁定。 |
8018 | -113 | 账号资料不完整。 |
Payment: billing server (6xxx)
Billing-server errors. The SDK maps each payment server return code to a 6xxx value (6000 = unknown fallback). Type = the source payment server code.
帳務伺服器錯誤。SDK 會將每個付款伺服器回傳碼對應到一個 6xxx 值(6000=未知備用)。Type=來源付款伺服器碼。
计费服务器错误。SDK 将每个支付服务器返回码映射为一个 6xxx 值(6000 = 未知兜底)。Type = 来源支付服务器码。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
6000 | unknown | Unknown billing-server error (fallback). |
6001 | 1 | Success (server returned code 1). |
6002 | -8 | System under maintenance (any payment-system error maps here). |
6003 | -70 | Payment error (uncategorized IAP pay failure). |
6004 | -71 | Invalid receipt (bad signature or mismatched package / product / order). |
6005 | -72 | Duplicate receipt (already verified successfully). |
6006 | -73 | Expired receipt (older than 72 hours). |
| 欄位 | 型別 | 說明 |
|---|---|---|
6000 | unknown | 未知的帳務伺服器錯誤(備用)。 |
6001 | 1 | 成功(伺服器回傳碼 1)。 |
6002 | -8 | 系統維護中(任何付款系統錯誤都對應到此)。 |
6003 | -70 | 付款錯誤(未分類的 IAP 付款失敗)。 |
6004 | -71 | 收據無效(簽章錯誤或 package/product/order 不符)。 |
6005 | -72 | 重複的收據(已成功驗證過)。 |
6006 | -73 | 收據已過期(超過 72 小時)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
6000 | unknown | 未知的计费服务器错误(兜底)。 |
6001 | 1 | 成功(服务器返回码 1)。 |
6002 | -8 | 系统维护中(任何支付系统错误都映射到此)。 |
6003 | -70 | 支付错误(未分类的 IAP 支付失败)。 |
6004 | -71 | 收据无效(签名错误或 package / product / order 不匹配)。 |
6005 | -72 | 收据重复(已成功验证过)。 |
6006 | -73 | 收据已过期(超过 72 小时)。 |
Payment: store / verification (9xxx)
Store, receipt, and verification errors raised during the purchase flow (9xxx client-side band). iOS and Android differ: both are merged here, so the same code number can carry a different meaning on each platform. Type shows the source symbol(s) (iOS / Android).
在購買流程期間引發的商店、收據與驗證錯誤(9xxx 用戶端分段)。iOS 與 Android 有所不同: 此處合併列出,同一組代碼在不同平台上可能代表不同含義。Type 欄顯示來源符號(iOS/Android)。
在购买流程中引发的商店、收据与验证错误(9xxx 客户端段)。iOS 与 Android 有所不同: 此处合并列出,同一组代码在不同平台上可能代表不同含义。Type 列显示来源符号(iOS / Android)。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
9006 | paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEM | iOS: the purchase info is invalid. Android: product not found on the pre-purchase inventory check. |
9007 | paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM | Product id not found. |
9008 | paymentVerificationInProgress / ITEM_IS_VERIFYING | A verification is already in progress. |
9009 | paymentCanceled / PAYMENT_CANCEL | Player canceled the purchase. |
9010 | NOT_SIGN_IN_GOOGLE_PLAY | Android: the player is not signed in to Google Play. |
9011 | NOT_REGISTER_ITEM | Android: the item / reward package is not registered. |
9012 | HAS_SUBSCRIPTION | Android: the player already owns an active subscription for this item. |
9013 | PRODUCT_IS_PENDING | Android: the purchase is pending (not yet completed). |
9014 | PURCHASE_FAILED_WITH_BILLING_ERROR | Android: purchase failed due to a Google Play billing error. |
9015 | PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LIST | Android: purchase failed. The returned purchase list did not contain the item. |
9016 | paymentRetrieveAppleReceiptFailed | iOS: could not read the App Store receipt. |
9017 | paymentOrderDataInvalid | iOS: the order data is invalid. |
9049 | paymentPending | iOS: the purchase is pending approval (deferred / Ask-to-Buy). |
| 欄位 | 型別 | 說明 |
|---|---|---|
9006 | paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEM | iOS: 購買資訊無效。Android: 購買前查詢庫存時找不到該商品。 |
9007 | paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM | 找不到商品 ID。 |
9008 | paymentVerificationInProgress / ITEM_IS_VERIFYING | 已有一項驗證正在進行中。 |
9009 | paymentCanceled / PAYMENT_CANCEL | 玩家取消了購買。 |
9010 | NOT_SIGN_IN_GOOGLE_PLAY | Android: 尚未登入 Google Play。 |
9011 | NOT_REGISTER_ITEM | Android: 道具/獎勵包未註冊。 |
9012 | HAS_SUBSCRIPTION | Android: 已擁有此項目的有效訂閱。 |
9013 | PRODUCT_IS_PENDING | Android: 購買處於待處理狀態(尚未完成)。 |
9014 | PURCHASE_FAILED_WITH_BILLING_ERROR | Android: 因 Google Play 帳務錯誤導致購買失敗。 |
9015 | PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LIST | Android: 購買失敗。回傳的購買清單未包含該項目。 |
9016 | paymentRetrieveAppleReceiptFailed | iOS: 無法讀取 App Store 收據。 |
9017 | paymentOrderDataInvalid | iOS: 訂單資料無效。 |
9049 | paymentPending | iOS: 購買正等待核准(延遲/需家長同意)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
9006 | paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEM | iOS: 购买信息无效。Android: 购买前查询库存时找不到该商品。 |
9007 | paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM | 找不到商品 id。 |
9008 | paymentVerificationInProgress / ITEM_IS_VERIFYING | 已有一个验证正在进行中。 |
9009 | paymentCanceled / PAYMENT_CANCEL | 玩家取消了购买。 |
9010 | NOT_SIGN_IN_GOOGLE_PLAY | Android: 尚未登录 Google Play。 |
9011 | NOT_REGISTER_ITEM | Android: 道具 / 奖励包未注册。 |
9012 | HAS_SUBSCRIPTION | Android: 已拥有此项目的有效订阅。 |
9013 | PRODUCT_IS_PENDING | Android: 购买处于待处理状态(尚未完成)。 |
9014 | PURCHASE_FAILED_WITH_BILLING_ERROR | Android: 因 Google Play 结算错误导致购买失败。 |
9015 | PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LIST | Android: 购买失败。返回的购买列表未包含该商品。 |
9016 | paymentRetrieveAppleReceiptFailed | iOS: 无法读取 App Store 收据。 |
9017 | paymentOrderDataInvalid | iOS: 订单数据无效。 |
9049 | paymentPending | iOS: 购买正在等待批准(延迟 / 需家长同意)。 |
Social (9xxx)
Facebook and Instagram profile / share / invite failures.
Facebook 與 Instagram 的個人檔案/分享/邀請失敗。
Facebook 与 Instagram 的资料 / 分享 / 邀请失败。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
9024 | facebookGetProfileNullResult | Facebook profile fetch returned no result. |
9026 | facebookShareEmptyPhoto | No photo supplied to share. |
9027 | facebookAppNotInstalled | Facebook app is not installed. |
9028 | facebookShareEmptyLink | No link supplied to share. |
9029 | facebookInviteFriendTitleAndMessageEmpty | Invite title and message are both empty. |
9030 | facebookShareCanceled | Player canceled the share. |
9031 | facebookInviteFriendCanceled | Player canceled the invite. |
9032 | instagramAppNotInstalled | Instagram app is not installed. |
9033 | instagramPhotoLibraryNotAllowed | Photo-library access not granted. |
9034 | instagramShareEmptyPhoto | No photo supplied to share. |
9035 | facebookUnsupported | Facebook feature not enabled in this build. |
9038 | instagramUnsupported | Instagram feature not enabled in this build. |
| 欄位 | 型別 | 說明 |
|---|---|---|
9024 | facebookGetProfileNullResult | Facebook 個人檔案取得未傳回任何結果。 |
9026 | facebookShareEmptyPhoto | 未提供要分享的相片。 |
9027 | facebookAppNotInstalled | 未安裝 Facebook 應用程式。 |
9028 | facebookShareEmptyLink | 未提供要分享的連結。 |
9029 | facebookInviteFriendTitleAndMessageEmpty | 邀請的標題與訊息皆為空。 |
9030 | facebookShareCanceled | 玩家取消了分享。 |
9031 | facebookInviteFriendCanceled | 玩家取消了邀請。 |
9032 | instagramAppNotInstalled | 未安裝 Instagram 應用程式。 |
9033 | instagramPhotoLibraryNotAllowed | 未授予相片庫存取權。 |
9034 | instagramShareEmptyPhoto | 未提供要分享的相片。 |
9035 | facebookUnsupported | 此版本未啟用 Facebook 功能。 |
9038 | instagramUnsupported | 此版本未啟用 Instagram 功能。 |
| 字段 | 类型 | 描述 |
|---|---|---|
9024 | facebookGetProfileNullResult | Facebook 资料获取未返回结果。 |
9026 | facebookShareEmptyPhoto | 未提供要分享的照片。 |
9027 | facebookAppNotInstalled | 未安装 Facebook 应用。 |
9028 | facebookShareEmptyLink | 未提供要分享的链接。 |
9029 | facebookInviteFriendTitleAndMessageEmpty | 邀请标题和消息均为空。 |
9030 | facebookShareCanceled | 玩家取消了分享。 |
9031 | facebookInviteFriendCanceled | 玩家取消了邀请。 |
9032 | instagramAppNotInstalled | 未安装 Instagram 应用。 |
9033 | instagramPhotoLibraryNotAllowed | 未授予相册访问权限。 |
9034 | instagramShareEmptyPhoto | 未提供要分享的照片。 |
9035 | facebookUnsupported | 此构建版本未启用 Facebook 功能。 |
9038 | instagramUnsupported | 此构建版本未启用 Instagram 功能。 |
General & availability (9xxx)
Cross-cutting client errors any flow can surface, plus feature-availability sentinels. Customer support surfaces an error with the string code invalid_payload. (Reserved/unused: 9004, and 9010 to 9015.)
任何流程都可能出現的橫切用戶端錯誤,以及功能可用性的哨符值。客戶支援會以字串碼 invalid_payload 呈現一個錯誤。(保留/未使用:9004、9010 至 9015)
任何流程都可能暴露的横切客户端错误,以及功能可用性哨兵值。客户支持会以字符串码 invalid_payload 暴露一个错误。(保留 / 未使用:9004、9010 至 9015)
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
9000 | undefined | Undefined / unknown error. |
9001 | networkFailed | Network request failed (retryable). |
9002 | wrongDataFormat | Malformed response data. |
9003 | cancelLogin | Login canceled (SDK band). |
9005 | googleRefreshTokenFailed | Google token refresh failed. |
9018 | appleCredentialNotFoundInAuthorizationResult | Apple authorization returned no credential. |
9019 | googleConfigNotFound | Google config missing. |
9020 | facebookConfigNotFound | Facebook config missing. |
9021 | appleTwoAuthenticationError | Sign in with Apple 2FA error. |
9022 | appleCancelError | Player canceled Sign in with Apple. |
9023 | appleOtherError | Other Sign in with Apple error. |
9025 | appleCachedCredentialNotFound | No cached Apple credential. |
9036 | googleUnsupported | Google login not enabled in this build. |
9037 | vgaUnsupported | VGA login not enabled in this build. |
9047 | firebaseUnsupported | Firebase not enabled in this build. |
404 | featureNotSupported | Unity: the called method is not supported on the current native platform (PassAPI.NotApplicable): e.g. CheckReward / VerifyReward / RequestPermission on iOS, or DeleteAccount on Android. |
-1 | featureDisabled | Unity: the feature’s native framework was not bundled at build time (Facebook, StoreKit, IronSource, Meta Audience Network, CleverTap…), or a Meta-ads reward-server failure. |
| 欄位 | 型別 | 說明 |
|---|---|---|
9000 | undefined | 未定義/未知的錯誤。 |
9001 | networkFailed | 網路請求失敗(可重試)。 |
9002 | wrongDataFormat | 回應資料格式錯誤。 |
9003 | cancelLogin | 登入已取消(SDK 分段)。 |
9005 | googleRefreshTokenFailed | Google 權杖重新整理失敗。 |
9018 | appleCredentialNotFoundInAuthorizationResult | Apple 授權未傳回任何憑證。 |
9019 | googleConfigNotFound | 缺少 Google 設定。 |
9020 | facebookConfigNotFound | 缺少 Facebook 設定。 |
9021 | appleTwoAuthenticationError | 使用 Apple 登入的兩階段驗證錯誤。 |
9022 | appleCancelError | 玩家取消了使用 Apple 登入。 |
9023 | appleOtherError | 其他使用 Apple 登入的錯誤。 |
9025 | appleCachedCredentialNotFound | 沒有快取的 Apple 憑證。 |
9036 | googleUnsupported | 此版本未啟用 Google 登入。 |
9037 | vgaUnsupported | 此版本未啟用 VGA 登入。 |
9047 | firebaseUnsupported | 此版本未啟用 Firebase。 |
404 | featureNotSupported | Unity: 所呼叫的方法在目前的原生平台上不支援(PassAPI.NotApplicable):例如 iOS 上的 CheckReward/VerifyReward/RequestPermission,或 Android 上的 DeleteAccount。 |
-1 | featureDisabled | Unity: 該功能的原生框架在建置時未打包(Facebook、StoreKit、IronSource、Meta Audience Network、CleverTap…),或 Meta 廣告獎勵伺服器失敗。 |
| 字段 | 类型 | 描述 |
|---|---|---|
9000 | undefined | 未定义 / 未知错误。 |
9001 | networkFailed | 网络请求失败(可重试)。 |
9002 | wrongDataFormat | 响应数据格式错误。 |
9003 | cancelLogin | 登录已取消(SDK 段)。 |
9005 | googleRefreshTokenFailed | Google 令牌刷新失败。 |
9018 | appleCredentialNotFoundInAuthorizationResult | Apple 授权未返回凭据。 |
9019 | googleConfigNotFound | 缺少 Google 配置。 |
9020 | facebookConfigNotFound | 缺少 Facebook 配置。 |
9021 | appleTwoAuthenticationError | Sign in with Apple 双重验证(2FA)错误。 |
9022 | appleCancelError | 玩家取消了 Sign in with Apple。 |
9023 | appleOtherError | 其他 Sign in with Apple 错误。 |
9025 | appleCachedCredentialNotFound | 没有缓存的 Apple 凭据。 |
9036 | googleUnsupported | 此构建版本未启用 Google 登录。 |
9037 | vgaUnsupported | 此构建版本未启用 VGA 登录。 |
9047 | firebaseUnsupported | 此构建版本未启用 Firebase。 |
404 | featureNotSupported | Unity: 所调用的方法在当前原生平台上不支持(PassAPI.NotApplicable):例如 iOS 上的 CheckReward / VerifyReward / RequestPermission,或 Android 上的 DeleteAccount。 |
-1 | featureDisabled | Unity: 该功能的原生框架在构建时未打包(Facebook、StoreKit、IronSource、Meta Audience Network、CleverTap…),或 Meta 广告奖励服务器失败。 |