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-json 3.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-json 3.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.plistpass-services.jsongoogle-services.json)由 OP Tool 提供。
  • VNGGames SDK 包: 获取最新的 VNGGames SDK zip 文件。
  • Unity: 2021、2022、2023 或 6(LTS)。
  • 依赖包: com.unity.nuget.newtonsoft-json 3.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.plistpass-services.jsongoogle-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 项目。

LibraryVersionGroup
com.unity.nuget.newtonsoft-json3.0.1Core
函式庫版本分組
com.unity.nuget.newtonsoft-json3.0.1核心
版本分组
com.unity.nuget.newtonsoft-json3.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>.unitypackage

Importing 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.configSCENETARGETBUNDLE_ID),然後:

iOS: Xcode 工程。 编辑 export-xcode.configSCENETARGETBUNDLE_ID),然后:

./export-xcode-project.sh                 # uses export-xcode.config
./export-xcode-project.sh --target device # device | simulator | both

Android: 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.configSCENEBUNDLE_ID),匯出後再設定專案以符合最新的 Android Studio(JDK 17 · AGP 8.5.1 · Gradle 8.9 · NDK 28+):

Android: Gradle 工程。 编辑 export-android.configSCENEBUNDLE_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 building

Install 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 the Xcode-simulator project 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-* or Exported/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 iphonesimulator so it builds.
  • Keep the helper scripts, the .unitypackage, and VNGGamesSDKDemo/ 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 以便建置。
  • 請將輔助指令碼、.unitypackageVNGGamesSDKDemo/ 一起放在發佈包根目錄: 指令碼會將專案與套件作為同級目錄自動偵測。
  • 导出脚本以批处理模式运行 Unity,并生成一个一次性的构建脚本,退出时删除: 不会在你工程里留下文件。
  • SDK 的原生接线会在导出时自动完成:iOS 的 plist/能力由 iOS 后处理完成,Android 的 Gradle 文件由 IPostGenerateGradleAndroidProject 完成。
  • 可安全重复运行: 每次导出都会清空并重建自己的输出目录(Exported/Xcode-*Exported/Android),且导入 SDK 是幂等的。
  • iOS 模拟器:Unity 会写入真机 SDK。导出器会自动修正模拟器工程回 iphonesimulator 以便构建。
  • 请将辅助脚本、.unitypackageVNGGamesSDKDemo/ 一起放在分发包根目录: 脚本会将工程与包作为同级目录自动检测。

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

AndroidiOS

Presents 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。

Auto login

AndroidiOS

Silently 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。

Direct login to a channel

AndroidiOS

Signs in to one channel directly, bypassing the picker.

直接登入單一頻道,略過選擇器。

直接登录单一渠道,跳过选择器。

PassSDK.Instance.DirectLogin(LoginChannel.Google, result =>
{
    result.Match(
        user => { /* signed in */ },
        error => { /* handle failure */ });
});

Input

輸入

输入

FieldTypeDescription
channelLoginChannelChannel to sign in to: see LoginChannel.
欄位型別說明
channelLoginChannel要登入的頻道: 請參閱 LoginChannel
字段类型描述
channelLoginChannel要登录的渠道: 请参阅 LoginChannel

Output

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。

Log out

AndroidiOS

Signs 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.

你的遊戲伺服器驗證玩家的工作階段,而不是從用戶端。登入回呼把 userIDsessionID 交給遊戲之後,遊戲的後端以 application/x-www-form-urlencoded 將兩者 POST 到 /api/login/checkSession,只有在 returnCode1 時才信任該玩家。SDK 沒有對應的呼叫,用戶端也沒有等價做法:用戶端可以宣稱任何工作階段,這正是需要這道檢查的原因。要送往的網域與你的遊戲 secret key 需另行申請,見下方說明。

你的游戏服务器验证玩家的会话,而不是从客户端。登录回调把 userIDsessionID 交给游戏之后,游戏的后端以 application/x-www-form-urlencoded 将两者 POST 到 /api/login/checkSession,只有在 returnCode1 时才信任该玩家。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

輸入

输入

FieldTypeDescription
userIDstringUnique VNGGames user id.
sessionIDstringSession token used to authenticate backend calls.
gameIDstringA VNGGames Account credential the SDK reads.
timestampstringUnix time in SECONDS at the moment of the call.
sigstringChecksum 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.
欄位型別說明
userIDstringVNGGames 唯一使用者 ID。
sessionIDstring用於驗證後端呼叫的工作階段權杖。
gameIDstringSDK 會讀取的 VNGGames Account 憑證。
timestampstring發出呼叫當下的 Unix 時間,單位為「秒」。
sigstring其餘參數的檢查碼:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 團隊發給你的團隊,且只存在於伺服器端,這正是這個呼叫不能放在用戶端的原因。
字段类型描述
userIDstringVNGGames 唯一用户 ID。
sessionIDstring用于验证后端调用的会话令牌。
gameIDstringSDK 会读取的 VNGGames Account 凭据。
timestampstring发出调用当下的 Unix 时间,单位为「秒」。
sigstring其余参数的校验和:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 团队发给你的团队,且只存在于服务器端,这正是这个调用不能放在客户端的原因。

Output

輸出

输出

FieldTypeDescription
returnCodeintTreat 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.
messagestringHuman-readable result, for your server logs rather than for players.
datanullAlways null on this endpoint. The verdict is returnCode.
欄位型別說明
returnCodeint只要不是 1,一律視為未登入。
1 工作階段有效。
-1 sig 有誤。
-2 參數有誤。
-108 工作階段不存在。
-404 端點不存在。
-500 服務錯誤。
messagestring可讀的結果訊息,用於你的伺服器紀錄,而不是顯示給玩家。
datanull這個端點永遠回傳 null,判定結果看 returnCode
字段类型描述
returnCodeint只要不是 1,一律视为未登录。
1 会话有效。
-1 sig 有误。
-2 参数有误。
-108 会话不存在。
-404 端点不存在。
-500 服务错误。
messagestring可读的结果消息,用于你的服务器日志,而不是显示给玩家。
datanull这个端点永远返回 null,判定结果看 returnCode

Is delete-account enabled

iOS

Reports 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

輸出

输出

FieldTypeDescription
valuestring”true”/“false”: whether delete-account is available.
errorErrorPresent on failure: 404 when the feature is unsupported on this platform. See General error codes.
欄位型別說明
valuestring”true”/“false”: 刪除帳號是否可用。
errorError失敗時存在: 當該功能在目前原生平台不受支援時為 404。請參閱 一般錯誤碼
字段类型描述
valuestring”true”/“false”: 删除账号是否可用。
errorError失败时存在: 当该功能在当前原生平台不受支持时为 404。请参阅 通用错误码

Delete account

iOS

Runs 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

輸出

输出

FieldTypeDescription
valuestringDelete-account flow result.
errorErrorPresent on failure: 404 when the feature is unsupported on this platform. See General error codes.
欄位型別說明
valuestring刪除帳號流程的結果。
errorError失敗時存在: 當該功能在目前原生平台不受支援時為 404。請參閱 一般錯誤碼
字段类型描述
valuestring删除账号流程的结果。
errorError失败时存在: 当该功能在当前原生平台不受支持时为 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 登入時可用。v1PassSDK.shared)為第一代 API:快速登入透過登入回呼回傳結果。v2VGSDKQuickAuth)為以監聽器為基礎的門面:監聽器的 onSuccess 會傳回玩家資訊,onError 則傳回失敗原因。管理帳號 會開啟 VGA 帳號管理畫面,且適用於以任一版本登入的帳號。

零交互登录与 VGA 账号管理: 仅在 VGA 登录时可用。v1PassSDK.shared)为第一代 API:快速登录在登录回调上返回结果。v2VGSDKQuickAuth)为基于监听器的门面:监听器的 onSuccess 返回玩家信息,onError 返回失败原因。管理账号 会打开 VGA 账号管理界面,且适用于以任一版本登录的账号。

v1

Quick login

AndroidiOS

Signs 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

v2

Sign in

AndroidiOS

Presents 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

Play as guest

AndroidiOS

Signs 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

Show channel selection

AndroidiOS

Presents 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
valuePassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
valuePassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

Manage account

Open account management

AndroidiOS

Opens 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

輸出

输出

FieldTypeDescription
value.ActionVGSDKManageAccountActionThe action the player took. See VGSDKManageAccountAction.
value.UserInfoPassUserInfoThe signed-in player. Fields: PassUserInfo.
errorErrorPresent on cancel/failure: see VGA login error codes.
欄位型別說明
value.ActionVGSDKManageAccountAction玩家執行的操作。請參閱 VGSDKManageAccountAction
value.UserInfoPassUserInfo已登入的玩家。欄位詳見 PassUserInfo
errorError取消/失敗時存在: 請參閱 VGA 登入錯誤碼
字段类型描述
value.ActionVGSDKManageAccountAction玩家执行的操作。请参阅 VGSDKManageAccountAction
value.UserInfoPassUserInfo已登录的玩家。字段详见 PassUserInfo
errorError取消/失败时存在: 请参阅 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

AndroidiOS

Fetches 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

輸入

输入

FieldTypeDescription
idsstring[]List of configured item id from Store.
欄位型別說明
idsstring[]在商店設定的商品 id 清單。
字段类型描述
idsstring[]在商店配置的商品 id 列表。

Output

輸出

输出

FieldTypeDescription
valueVGSDKPaymentProductsThe products found. Empty when no id matched. Products: VGSDKPaymentProduct[].
errorErrorPresent on failure: see billing / store payment error codes.
欄位型別說明
valueVGSDKPaymentProducts找到的商品。沒有 id 相符時為空。ProductsVGSDKPaymentProduct[]。
errorError失敗時存在: 請參閱 帳務商店 付款錯誤碼。
字段类型描述
valueVGSDKPaymentProducts找到的商品。没有 id 匹配时为空。ProductsVGSDKPaymentProduct[]。
errorError失败时存在: 请参阅 计费 / 商店 支付错误码。

Purchase

AndroidiOS

Runs 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

輸入

输入

FieldTypeDescription
infoDictionary<string, string>The purchase request: keys userId, serverId, roleId, itemId, appTransId (and optional passthrough).
欄位型別說明
infoDictionary<string, string>購買請求: 鍵 userIdserverIdroleIditemIdappTransId(以及可選的傳遞資料)。
字段类型描述
infoDictionary<string, string>购买请求: 键 userIdserverIdroleIditemIdappTransId(以及可选的透传数据)。

Output

輸出

输出

FieldTypeDescription
valuestringOrder / receipt data on success.
errorErrorPurchase failed. See billing / store payment error codes.
欄位型別說明
valuestring成功時的訂單/收據資料。
errorError購買失敗。請參閱 帳務商店 付款錯誤碼。
字段类型描述
valuestring成功时的订单/收据数据。
errorError购买失败。请参阅 计费商店 支付错误码。

Check item reward

Android

Reports 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

輸出

输出

FieldTypeDescription
valuestring"available" when a reward is pending, "unavailable" when there is none.
errorErrorPresent on failure: Code 9007 (IAP_FAILED), message Failed to check reward.
欄位型別說明
valuestring有待發放的獎勵時為 "available",沒有時為 "unavailable"
errorError失敗時提供:Code 為 9007(IAP_FAILED),訊息為 Failed to check reward
字段类型描述
valuestring有待发放的奖励时为 "available",没有时为 "unavailable"
errorError失败时提供:Code 为 9007(IAP_FAILED),消息为 Failed to check reward

Verify reward

Android

Grants 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

輸入

输入

FieldTypeDescription
infoDictionary<string, string>The reward claim: keys userId, appTransId, roleId, serverId, addInfo. All five are required, a missing key throws instead of defaulting.
info.userIdstringBuyer’s VNGGames user id.
info.appTransIdstringYour app-side transaction id, for reconciliation.
info.roleIdstringCharacter/role id.
info.serverIdstringGame server id.
info.addInfostringExtra passthrough data. Empty string when unused.
欄位型別說明
infoDictionary<string, string>獎勵領取請求:鍵為 userIdappTransIdroleIdserverIdaddInfo。五個皆為必填,缺少任一個會直接拋出例外而非使用預設值。
info.userIdstringBuyer’s VNGGames user id.
info.appTransIdstringYour app-side transaction id, for reconciliation.
info.roleIdstringCharacter/role id.
info.serverIdstringGame server id.
info.addInfostringExtra passthrough data. Empty string when unused.
字段类型描述
infoDictionary<string, string>奖励领取请求:键为 userIdappTransIdroleIdserverIdaddInfo。五个均为必填,缺少任一个会直接抛出异常而非使用默认值。
info.userIdstringBuyer’s VNGGames user id.
info.appTransIdstringYour app-side transaction id, for reconciliation.
info.roleIdstringCharacter/role id.
info.serverIdstringGame server id.
info.addInfostringExtra passthrough data. Empty string when unused.

Output

輸出

输出

FieldTypeDescription
valuestring"success" when the reward was granted.
errorErrorPresent 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.
欄位型別說明
valuestring獎勵發放成功時為 "success"
errorError失敗時提供:Code 為 9007 表示暫時性失敗,可安全重試。Code 為 9000 表示永久失敗,請勿以相同請求重試。
字段类型描述
valuestring奖励发放成功时为 "success"
errorError失败时提供: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 formula vgsdk_{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

AndroidiOS

Required 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

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
roleNamestringCharacter/role name.
欄位型別說明
roleIdstring角色 ID。
roleNamestring角色名稱。
字段类型描述
roleIdstring角色 id。
roleNamestring角色名称。

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_purchaseaf_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_purchaseaf_PURCHASE),並可包含非英文字元。
  • 每個事件: 最多 25 個參數。
  • 參數名稱 最多 40 個字元。
  • 參數值 不得超過 1000 個字元(過長的值可能會被截斷)。請將事件的總值控制在 2000 個字元以內。
  • 收益/價格值 僅能使用數字與單一小數點,小數點後最多 5 位數。
  • 基數: 每天最多 300 個不重複的事件名稱。
  • 不重複使用者 僅在使用者安裝應用程式後的前 100 個事件內計算。
  • 來源 URL 必須經過 URL 編碼。
  • Meta(Facebook)Ads 對事件參數施加額外限制。

适用于你通过此门面发送的每个事件的约束: 它们汇总了底层各提供方的规则。在埋点前请先阅读:

  • 事件名称 必须以字母开头,不含空格(使用下划线),且最多 100 个字符。不得以 "\=+- 开头,区分大小写(af_purchaseaf_PURCHASE),并且可以包含非英文字符。
  • 每个事件: 最多 25 个参数。
  • 参数名称 最多 40 个字符。
  • 参数值 不得超过 1000 个字符(过长的值可能被截断)。请将事件的总值保持在 2000 个字符以内。
  • 收入 / 价格值 只能使用数字和单个小数点,小数点后最多 5 位。
  • 基数(Cardinality): 每天最多 300 个唯一事件名称。
  • 唯一用户 仅统计用户安装应用后的前 100 个事件。
  • 引荐 URL(Referring URLs) 必须经过 URL 编码。
  • Meta(Facebook)广告 对事件参数施加额外限制。

Custom event

Send a custom event

AndroidiOS

Sends 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

輸入

输入

FieldTypeDescription
eventNamestringEvent name.
parametersDictionary<string, string>Event parameters.
platformsList<VGSDKAnalyticsPlatform>Target providers. Each entry selects a provider + event-name prefix.
platforms[].ProviderVGSDKAnalyticsProviderProvider to send to: see VGSDKAnalyticsProvider.
platforms[].PrefixstringPrefix prepended to the event name for that provider.
欄位型別說明
eventNamestring事件名稱。
parametersDictionary<string, string>事件參數。
platformsList<VGSDKAnalyticsPlatform>目標供應商。每個項目會選擇一個供應商+事件名稱前綴。
platforms[].ProviderVGSDKAnalyticsProvider要傳送到的供應商: 請參閱 VGSDKAnalyticsProvider
platforms[].Prefixstring為該供應商加在事件名稱前的前綴。
字段类型描述
eventNamestring事件名称。
parametersDictionary<string, string>事件参数。
platformsList<VGSDKAnalyticsPlatform>目标提供方。每个条目选择一个提供方 + 事件名称前缀。
platforms[].ProviderVGSDKAnalyticsProvider要发送到的提供方: 请参阅 VGSDKAnalyticsProvider
platforms[].Prefixstring为该提供方在事件名称前添加的前缀。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Misc: custom event

AndroidiOS

Sends 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

輸入

输入

FieldTypeDescription
eventNamestringEvent name.
parametersDictionary<string, string>Event parameters.
欄位型別說明
eventNamestring事件名稱。
parametersDictionary<string, string>事件參數。
字段类型描述
eventNamestring事件名称。
parametersDictionary<string, string>事件参数。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Conversion Rate

1. App open

AndroidiOS

Logs an app open.

記錄一次應用程式開啟。

记录一次应用打开。

VGSDKAnalytics.RegAppOpen(new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

2. Get configuration

AndroidiOS

Logs the configuration fetch.

記錄設定的取得。

记录配置获取。

VGSDKAnalytics.RegGetConfiguration(new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

3. Check configuration start

AndroidiOS

Logs the start of a configuration check.

記錄一次設定檢查的開始。

记录配置检查的开始。

VGSDKAnalytics.RegCheckConfigurationStart(new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

4. Check configuration end

AndroidiOS

Logs the end of a configuration check.

記錄一次設定檢查的結束。

记录配置检查的结束。

VGSDKAnalytics.RegCheckConfigurationEnd(new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

5. CDN download start

AndroidiOS

Logs the start of a CDN resource download.

記錄一次 CDN 資源下載的開始。

记录 CDN 资源下载的开始。

VGSDKAnalytics.RegCDNDownloadStart("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

6. CDN download 25%

AndroidiOS

Logs 25% CDN download progress.

記錄 CDN 下載 25% 的進度。

记录 CDN 下载进度 25%。

VGSDKAnalytics.RegCDNDownload25("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

6. CDN download 50%

AndroidiOS

Logs 50% CDN download progress.

記錄 CDN 下載 50% 的進度。

记录 CDN 下载进度 50%。

VGSDKAnalytics.RegCDNDownload50("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

6. CDN download 75%

AndroidiOS

Logs 75% CDN download progress.

記錄 CDN 下載 75% 的進度。

记录 CDN 下载进度 75%。

VGSDKAnalytics.RegCDNDownload75("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. CDN download finish

AndroidiOS

Logs CDN download completion.

記錄 CDN 下載完成。

记录 CDN 下载完成。

VGSDKAnalytics.RegCDNDownloadFinish("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

8. Extract resource start

AndroidiOS

Logs the start of resource extraction.

記錄一次資源解壓的開始。

记录资源解压的开始。

VGSDKAnalytics.RegExtractResourceStart("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

9. Extract resource end

AndroidiOS

Logs the end of resource extraction.

記錄一次資源解壓的結束。

记录资源解压的结束。

VGSDKAnalytics.RegExtractResourceEnd("10MB", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
sizestringPayload / resource size.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
sizestring負載/資源大小。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
sizestring负载 / 资源大小。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Onboarding

1. Joined server

AndroidiOS

Logs a new user joining a server.

記錄新使用者加入伺服器。

记录新用户加入服务器。

VGSDKAnalytics.NruJoinedServer("server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

2. Named role

AndroidiOS

Logs a role being named.

記錄角色被命名。

记录角色被命名。

VGSDKAnalytics.NruNamedRole("server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

3. Create role success

AndroidiOS

Logs successful role creation.

記錄角色建立成功。

记录角色创建成功。

VGSDKAnalytics.NruCreateRoleSuccess("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

4. Tutorial start

AndroidiOS

Logs the tutorial starting.

記錄教學開始。

记录教程开始。

VGSDKAnalytics.NruTutorialStart("role-1", "server-1", "0", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
progressstringProgress marker.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
progressstring進度標記。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
progressstring进度标记。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

5. Tutorial 25%

AndroidiOS

Logs 25% tutorial progress.

記錄教學 25% 的進度。

记录教程进度 25%。

VGSDKAnalytics.NruTutorialProgress25("role-1", "server-1", "25", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
progressstringProgress marker.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
progressstring進度標記。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
progressstring进度标记。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

5. Tutorial 50%

AndroidiOS

Logs 50% tutorial progress.

記錄教學 50% 的進度。

记录教程进度 50%。

VGSDKAnalytics.NruTutorialProgress50("role-1", "server-1", "50", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
progressstringProgress marker.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
progressstring進度標記。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
progressstring进度标记。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

5. Tutorial 75%

AndroidiOS

Logs 75% tutorial progress.

記錄教學 75% 的進度。

记录教程进度 75%。

VGSDKAnalytics.NruTutorialProgress75("role-1", "server-1", "75", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
progressstringProgress marker.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
progressstring進度標記。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
progressstring进度标记。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

6. Tutorial finish

AndroidiOS

Logs tutorial completion.

記錄教學完成。

记录教程完成。

VGSDKAnalytics.NruTutorialProgressFinish("role-1", "server-1", "100", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
progressstringProgress marker.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
progressstring進度標記。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
progressstring进度标记。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. Open shop

AndroidiOS

Logs the shop being opened.

記錄商店被開啟。

记录商店被打开。

VGSDKAnalytics.IapOpenShop("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. Click to buy

AndroidiOS

Logs the intent to buy an item.

記錄購買道具的意圖。

记录购买物品的意向。

VGSDKAnalytics.IapClickToBuyItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
itemIdstringItem id.
itemNamestringItem name.
itemPricestringItem price.
itemCurrencystringCurrency code.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
itemIdstring道具 ID。
itemNamestring道具名稱。
itemPricestring道具價格。
itemCurrencystring貨幣代碼。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
itemIdstring物品 id。
itemNamestring物品名称。
itemPricestring物品价格。
itemCurrencystring货币代码。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. Purchased item

AndroidiOS

Logs a completed purchase.

記錄一次完成的購買。

记录一次完成的购买。

VGSDKAnalytics.IapPurchasedItem("role-1", "server-1", "item-1", "Gold Pack", "22000", "VND", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
itemIdstringItem id.
itemNamestringItem name.
itemPricestringItem price.
itemCurrencystringCurrency code.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
itemIdstring道具 ID。
itemNamestring道具名稱。
itemPricestring道具價格。
itemCurrencystring貨幣代碼。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
itemIdstring物品 id。
itemNamestring物品名称。
itemPricestring物品价格。
itemCurrencystring货币代码。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. VIP level up

AndroidiOS

Logs a VIP tier increase.

記錄 VIP 等級提升。

记录 VIP 等级提升。

VGSDKAnalytics.IapVipLevelUp("role-1", "server-1", "3", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
currentVipLevelstringNew VIP level.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
currentVipLevelstring新的 VIP 等級。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
currentVipLevelstring新的 VIP 等级。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. Buy VIP reward level

AndroidiOS

Logs 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

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
itemIdstringItem id.
itemNamestringItem name.
itemVipLevelstringVIP level of the item.
itemPricestringItem price.
itemCurrencystringCurrency code.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
itemIdstring道具 ID。
itemNamestring道具名稱。
itemVipLevelstring道具的 VIP 等級。
itemPricestring道具價格。
itemCurrencystring貨幣代碼。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
itemIdstring物品 id。
itemNamestring物品名称。
itemVipLevelstring物品的 VIP 等级。
itemPricestring物品价格。
itemCurrencystring货币代码。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. Level up

AndroidiOS

Logs a character level-up.

記錄角色升級。

记录角色升级。

VGSDKAnalytics.MdaLevelUp("role-1", "server-1", "42", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
currentLevelstringNew level.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
currentLevelstring新的等級。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
currentLevelstring新的等级。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

7. Agree to terms

AndroidiOS

Logs acceptance of all terms.

記錄同意所有條款。

记录接受所有条款。

VGSDKAnalytics.NruAgreeAllTerm(new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Main & Daily Activities

Main quest

AndroidiOS

Logs main-quest progress.

記錄主線任務的進度。

记录主线任务进度。

VGSDKAnalytics.MdaMainQuest("role-1", "server-1", "q1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
mainQuestIdstringMain-quest id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
mainQuestIdstring主線任務 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
mainQuestIdstring主线任务 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Daily quest

AndroidiOS

Logs daily-quest progress.

記錄每日任務的進度。

记录每日任务进度。

VGSDKAnalytics.MdaDailyQuest("role-1", "server-1", "d1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
dailyQuestIdstringDaily-quest id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
dailyQuestIdstring每日任務 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
dailyQuestIdstring每日任务 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Grant daily reward

AndroidiOS

Logs a daily reward grant.

記錄一次每日獎勵的發放。

记录发放一次每日奖励。

VGSDKAnalytics.MdaGrantDailyReward("role-1", "server-1", "r1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
dailyRewardIdstringDaily-reward id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
dailyRewardIdstring每日獎勵 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
dailyRewardIdstring每日奖励 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Buy item

AndroidiOS

Logs an in-game (soft-currency) item purchase.

記錄一次遊戲內(軟性貨幣)道具購買。

记录一次游戏内(软通货)物品购买。

VGSDKAnalytics.MdaBuyItem("role-1", "server-1", "item-1", "Potion", "100", "gold", "5", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
itemIdstringItem id.
itemNamestringItem name.
itemPricestringItem price.
itemCurrencystringCurrency code.
itemQuantitystringItem quantity.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
itemIdstring道具 ID。
itemNamestring道具名稱。
itemPricestring道具價格。
itemCurrencystring貨幣代碼。
itemQuantitystring道具數量。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
itemIdstring物品 id。
itemNamestring物品名称。
itemPricestring物品价格。
itemCurrencystring货币代码。
itemQuantitystring物品数量。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Spend item

AndroidiOS

Logs spending/consuming an item.

記錄花費/消耗道具。

记录消耗 / 使用一个物品。

VGSDKAnalytics.MdaSpendItem("role-1", "server-1", "item-1", "Potion", "100", "gold", "5", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
itemIdstringItem id.
itemNamestringItem name.
itemPricestringItem price.
itemCurrencystringCurrency code.
itemQuantitystringItem quantity.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
itemIdstring道具 ID。
itemNamestring道具名稱。
itemPricestring道具價格。
itemCurrencystring貨幣代碼。
itemQuantitystring道具數量。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
itemIdstring物品 id。
itemNamestring物品名称。
itemPricestring物品价格。
itemCurrencystring货币代码。
itemQuantitystring物品数量。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Gacha

AndroidiOS

Logs a gacha pull.

記錄一次轉蛋抽取。

记录一次抽卡。

VGSDKAnalytics.MdaGacha("role-1", "server-1", "banner-a", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
gachaTypestringGacha type/banner.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
gachaTypestring轉蛋類型/卡池。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
gachaTypestring抽卡类型 / 卡池。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Social & Communities

Create guild

AndroidiOS

Logs a guild-creation event.

記錄一次公會建立事件。

记录一次公会创建事件。

VGSDKAnalytics.ScCreateGuild("role-1", "server-1", "g1", "Guild", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
guildIdstringGuild id.
guildNamestringGuild name.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
guildIdstring公會 ID。
guildNamestring公會名稱。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
guildIdstring公会 id。
guildNamestring公会名称。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Join guild

AndroidiOS

Logs a guild-join event.

記錄一次加入公會事件。

记录一次加入公会事件。

VGSDKAnalytics.ScJoinGuild("role-1", "server-1", "g1", "Guild", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
guildIdstringGuild id.
guildNamestringGuild name.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
guildIdstring公會 ID。
guildNamestring公會名稱。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
guildIdstring公会 id。
guildNamestring公会名称。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Quit guild

AndroidiOS

Logs a guild-quit event.

記錄一次退出公會事件。

记录一次退出公会事件。

VGSDKAnalytics.ScQuitGuild("role-1", "server-1", "g1", "Guild", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
guildIdstringGuild id.
guildNamestringGuild name.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
guildIdstring公會 ID。
guildNamestring公會名稱。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
guildIdstring公会 id。
guildNamestring公会名称。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Add friend

AndroidiOS

Logs adding a friend on a platform.

記錄在平台上新增一位好友。

记录在某平台上添加好友。

VGSDKAnalytics.ScAddFriendToList("role-1", "server-1", "facebook", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
platformstringSocial platform name.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
platformstring社群平台名稱。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
platformstring社交平台名称。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Remove friend

AndroidiOS

Logs removing a friend on a platform.

記錄在平台上移除一位好友。

记录在某平台上移除好友。

VGSDKAnalytics.ScRemoveFriendFromList("role-1", "server-1", "facebook", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
platformstringSocial platform name.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
platformstring社群平台名稱。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
platformstring社交平台名称。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Share to Facebook

AndroidiOS

Logs a share-to-Facebook event.

記錄一次分享到 Facebook 的事件。

记录一次分享到 Facebook 的事件。

VGSDKAnalytics.ScShareToFacebook("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Invite Facebook friend

AndroidiOS

Logs a Facebook friend-invite event.

記錄一次 Facebook 好友邀請事件。

记录一次 Facebook 好友邀请事件。

VGSDKAnalytics.ScInviteFacebookFriend("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Share to Instagram

AndroidiOS

Logs a share-to-Instagram event.

記錄一次分享到 Instagram 的事件。

记录一次分享到 Instagram 的事件。

VGSDKAnalytics.ScShareToInstagram("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Other

Splash screen

AndroidiOS

Logs the splash screen being shown.

記錄啟動畫面被顯示。

记录启动画面的展示。

VGSDKAnalytics.RegSplashScreen(new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Purchase canceled

AndroidiOS

Logs a canceled purchase.

記錄一次已取消的購買。

记录一次已取消的购买。

VGSDKAnalytics.IapPurchasedCanceledItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
itemIdstringItem id.
itemNamestringItem name.
itemPricestringItem price.
itemCurrencystringCurrency code.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
itemIdstring道具 ID。
itemNamestring道具名稱。
itemPricestring道具價格。
itemCurrencystring貨幣代碼。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
itemIdstring物品 id。
itemNamestring物品名称。
itemPricestring物品价格。
itemCurrencystring货币代码。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Switch account

AndroidiOS

Logs an account switch.

記錄一次帳號切換。

记录一次账号切换。

VGSDKAnalytics.MiscSwitchAccount("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Customer support

AndroidiOS

Logs a customer-support entry.

記錄一次進入客戶支援。

记录一次进入客户支持。

VGSDKAnalytics.MiscCustomerSupport("role-1", "server-1", new Dictionary<string, string>());

Input

輸入

输入

FieldTypeDescription
roleIdstringCharacter/role id.
serverIdstringGame server id.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
roleIdstring角色 ID。
serverIdstring遊戲伺服器 ID。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdstring角色 id。
serverIdstring游戏服务器 id。
extraDataDictionary<string, string>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Ad revenue

AndroidiOS

Reports 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

輸入

输入

FieldTypeDescription
monetizationNetworkstringMonetization network name.
mediationNetworkVGSDKAdRevenueMediationNetworkMediation network: see Ad revenue mediation network.
revenuedoubleRevenue amount.
currencyCodestringCurrency code.
extraDataDictionary<string, string>Additional custom key/values attached to the event.
欄位型別說明
monetizationNetworkstring營利聯播網名稱。
mediationNetworkVGSDKAdRevenueMediationNetwork中介聯播網: 請參閱 廣告收益中介聯播網
revenuedouble收益金額。
currencyCodestring貨幣代碼。
extraDataDictionary<string, string>附加到事件的額外自訂鍵/值。
字段类型描述
monetizationNetworkstring变现网络名称。
mediationNetworkVGSDKAdRevenueMediationNetwork聚合网络: 请参阅 广告收入聚合网络
revenuedouble收入金额。
currencyCodestring货币代码。
extraDataDictionary<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

AndroidiOS

Presents 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

輸入

输入

FieldTypeDescription
infoDictionary<string, string>Player context: full model: VGSDKSupportInfo.
info.userIdstringUnique VNGGames user id.
info.serverIdstringGame server id.
info.levelstringPlayer level.
info.roleNamestringCharacter/role name.
info.loginChannelstringLogin channel.
info.guildstringGuild name.
info.contentstringPre-filled ticket content.
欄位型別說明
infoDictionary<string, string>玩家情境: 完整模型:VGSDKSupportInfo。
info.userIdstring使用者 ID。
info.serverIdstring伺服器 ID。
info.levelstring玩家等級。
info.roleNamestring角色名稱。
info.loginChannelstring登入頻道。
info.guildstring公會名稱。
info.contentstring預先填入的工單內容。
字段类型描述
infoDictionary<string, string>玩家上下文: 完整模型:VGSDKSupportInfo。
info.userIdstring用户 id。
info.serverIdstring服务器 id。
info.levelstring玩家等级。
info.roleNamestring角色名称。
info.loginChannelstring登录渠道。
info.guildstring公会名称。
info.contentstring预填的工单内容。

Output

輸出

输出

FieldTypeDescription
valueVGSDKSupportCenterListenerSupport-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.
errorErrorAn error occurred: see General error codes.
欄位型別說明
valueVGSDKSupportCenterListener支援中心事件監聽器: Type"action"(玩家在支援中心內執行的操作,Data 為其負載)或 "closed"(玩家關閉了支援中心)。DataDictionary<string, object>。失敗會透過 error 回傳,而非於此處。
errorError發生錯誤: 請參閱 一般錯誤碼
字段类型描述
valueVGSDKSupportCenterListener客户支持中心事件监听器: Type"action"(玩家在门户内执行的操作,Data 为其负载)或 "closed"(玩家关闭了客户支持中心)。DataDictionary<string, object>。失败通过 error 返回,而非此处。
errorError发生了错误: 请参阅 通用错误码

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

AndroidiOS

Initializes 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

輸入

输入

FieldTypeDescription
userIDstringPlayer id for the reward callback.
欄位型別說明
userIDstring用於獎勵回呼的玩家 ID。
字段类型描述
userIDstring用于奖励回调的玩家 id。

Output

輸出

输出

FieldTypeDescription
valuePassISRewardVideoRewarded-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.PlacementstringThe ironSource placement the event belongs to.
value.RewardedVideoStatusRewardedVideoStatusThe ad/reward lifecycle event: see RewardedVideoStatus.
value.AdInfostringAd metadata for the event, as a JSON string, when the mediation network provides it.
value.MessagestringEvent message. On adShowFailed (3) it carries the native ironSource error text: there is no VGSDK error code for ironSource rewarded video.
errorErrorPresent 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.
欄位型別說明
valuePassISRewardVideo獎勵影片廣告/獎勵事件。本次初始化及之後每次「顯示獎勵影片」的每個 ironSource 廣告與獎勵事件,都會作為一個 PassISRewardVideo(含以下欄位)送達這裡。
value.Placementstring該事件所屬的 ironSource 版位。
value.RewardedVideoStatusRewardedVideoStatus廣告/獎勵生命週期事件: 請參閱 RewardedVideoStatus
value.AdInfostring該事件的廣告中繼資料,為 JSON 字串(當中介網路提供時)。
value.Messagestring事件訊息。在 adShowFailed(3)時攜帶原生 ironSource 錯誤文字: ironSource 獎勵影片沒有 VGSDK 錯誤碼。
errorError僅在呼叫本身發生 SDK 級失敗時存在: 例如 -1(請參閱 一般錯誤碼)。廣告級失敗不在此回報: 它們透過 valueRewardedVideoStatus.adShowFailed(3)送達,錯誤位於 Message 中。
字段类型描述
valuePassISRewardVideo激励视频广告/奖励事件。本次初始化及之后每次“展示激励视频”的每个 ironSource 广告与奖励事件,都会作为一个 PassISRewardVideo(含以下字段)送达这里。
value.Placementstring该事件所属的 ironSource 广告位。
value.RewardedVideoStatusRewardedVideoStatus广告/奖励生命周期事件: 请参阅 RewardedVideoStatus
value.AdInfostring该事件的广告元数据,为 JSON 字符串(当聚合网络提供时)。
value.Messagestring事件消息。在 adShowFailed(3)时携带原生 ironSource 错误文本: ironSource 激励视频没有 VGSDK 错误码。
errorError仅在调用本身发生 SDK 级失败时存在: 例如 -1(请参阅 通用错误码)。广告级失败不在此报告: 它们通过 valueRewardedVideoStatus.adShowFailed(3)送达,错误位于 Message 中。

Show rewarded video

AndroidiOS

Shows 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

輸入

输入

FieldTypeDescription
placementNamestringPlacement to show.
isTrackNetworkStatestringWhether to track network state (“true”/“false”).
欄位型別說明
placementNamestring要顯示的版位。
isTrackNetworkStatestring是否追蹤網路狀態(“true”/“false”)。
字段类型描述
placementNamestring要展示的广告位。
isTrackNetworkStatestring是否跟踪网络状态(“true”/“false”)。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Set dynamic user id

AndroidiOS

Updates the ironSource dynamic user id used for server-to-server reward callbacks.

更新用於伺服器對伺服器獎勵回呼的 ironSource 動態使用者 ID。

更新用于服务端到服务端奖励回调的 ironSource 动态用户 id。

PassSDK.Instance.IronSourceSetDynamicUserId(userId);

Input

輸入

输入

FieldTypeDescription
userIDstringDynamic 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).
欄位型別說明
userIDstring用於驗證獎勵廣告交易的動態使用者 ID: 需在顯示廣告前設定。會在伺服器對伺服器獎勵回呼中回傳(1 至 64 個英數字元)。
字段类型描述
userIDstring用于验证激励广告交易的动态用户 id: 需在展示广告前设置。会在服务端到服务端奖励回调中返回(1 至 64 个字母数字字符)。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Meta Audience Network

Show interstitial

AndroidiOS

Shows 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

輸入

输入

FieldTypeDescription
placementIdstringMeta placement id.
欄位型別說明
placementIdstringMeta 版位 ID。
字段类型描述
placementIdstringMeta 广告位 id。

Output

輸出

输出

FieldTypeDescription
valueVGSDKMetaAdsInterstitialListenerAd-event listener.
value.StatusVGSDKMetaAdsInterstitialStatusThe interstitial ad event: see VGSDKMetaAdsInterstitialStatus.
value.AdInfostringAd metadata for the event, as a JSON string.
errorErrorLoad/show failed: carries the native Meta AdError (not a VGSDK code).
欄位型別說明
valueVGSDKMetaAdsInterstitialListener廣告事件監聽器。
value.StatusVGSDKMetaAdsInterstitialStatus插頁式廣告事件: 請參閱 VGSDKMetaAdsInterstitialStatus
value.AdInfostring該事件的廣告中繼資料(JSON 字串)。
errorError載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。
字段类型描述
valueVGSDKMetaAdsInterstitialListener广告事件监听器。
value.StatusVGSDKMetaAdsInterstitialStatus插屏广告事件: 请参阅 VGSDKMetaAdsInterstitialStatus
value.AdInfostring该事件的广告元数据(JSON 字符串)。
errorError加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。

Show rewarded video

AndroidiOS

Shows 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

輸入

输入

FieldTypeDescription
placementIdstringMeta placement id.
userIdstringPlayer id for the reward callback.
currencystringReward currency name.
欄位型別說明
placementIdstringMeta 版位 ID。
userIdstring用於獎勵回呼的玩家 ID。
currencystring獎勵貨幣名稱。
字段类型描述
placementIdstringMeta 广告位 id。
userIdstring用于奖励回调的玩家 id。
currencystring奖励货币名称。

Output

輸出

输出

FieldTypeDescription
valueVGSDKMetaAdsRewardedVideoListenerAd-event listener.
value.StatusVGSDKMetaAdsRewardedVideoStatusThe ad/reward event: see VGSDKMetaAdsRewardedVideoStatus.
value.AdInfostringAd metadata for the event, as a JSON string.
errorErrorLoad/show failed: carries the native Meta AdError (not a VGSDK code).
欄位型別說明
valueVGSDKMetaAdsRewardedVideoListener廣告事件監聽器。
value.StatusVGSDKMetaAdsRewardedVideoStatus廣告/獎勵事件: 請參閱 VGSDKMetaAdsRewardedVideoStatus
value.AdInfostring該事件的廣告中繼資料(JSON 字串)。
errorError載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。
字段类型描述
valueVGSDKMetaAdsRewardedVideoListener广告事件监听器。
value.StatusVGSDKMetaAdsRewardedVideoStatus广告/奖励事件: 请参阅 VGSDKMetaAdsRewardedVideoStatus
value.AdInfostring该事件的广告元数据(JSON 字符串)。
errorError加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。

Show rewarded interstitial

AndroidiOS

Shows 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

輸入

输入

FieldTypeDescription
placementIdstringMeta placement id.
userIdstringPlayer id for the reward callback.
currencystringReward currency name.
欄位型別說明
placementIdstringMeta 版位 ID。
userIdstring用於獎勵回呼的玩家 ID。
currencystring獎勵貨幣名稱。
字段类型描述
placementIdstringMeta 广告位 id。
userIdstring用于奖励回调的玩家 id。
currencystring奖励货币名称。

Output

輸出

输出

FieldTypeDescription
valueVGSDKMetaAdsRewardedInterstitialListenerAd-event listener.
value.StatusVGSDKMetaAdsRewardedInterstitialStatusThe ad/reward event: see VGSDKMetaAdsRewardedInterstitialStatus.
value.AdInfostringAd metadata for the event, as a JSON string.
errorErrorLoad/show failed: carries the native Meta AdError (not a VGSDK code).
欄位型別說明
valueVGSDKMetaAdsRewardedInterstitialListener廣告事件監聽器。
value.StatusVGSDKMetaAdsRewardedInterstitialStatus廣告/獎勵事件: 請參閱 VGSDKMetaAdsRewardedInterstitialStatus
value.AdInfostring該事件的廣告中繼資料(JSON 字串)。
errorError載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。
字段类型描述
valueVGSDKMetaAdsRewardedInterstitialListener广告事件监听器。
value.StatusVGSDKMetaAdsRewardedInterstitialStatus广告/奖励事件: 请参阅 VGSDKMetaAdsRewardedInterstitialStatus
value.AdInfostring该事件的广告元数据(JSON 字符串)。
errorError加载/展示失败: 携带原生 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

AndroidiOS

Registers 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

輸出

输出

FieldTypeDescription
valueDictionary<string, string>Payload of the tapped in-app-message button.
errorErrorPresent on failure.
欄位型別說明
valueDictionary<string, string>被點擊的應用程式內訊息按鈕的負載。
errorError失敗時存在。
字段类型描述
valueDictionary<string, string>被点击的应用内消息按钮的负载。
errorError失败时存在。

Open the app inbox

AndroidiOS

Opens the CleverTap-backed inbox.

開啟以 CleverTap 為後端的收件匣。

打开由 CleverTap 支持的收件箱。

VGSDKAppInbox.Open(new VGSDKAppInboxCleverTapProvider(new VGSDKAppInboxCleverTapStyle()), result =>
{
    result.Match(inbox => { /* inbox.Message / inbox.MessageContent */ }, error => { });
});

Input

輸入

输入

FieldTypeDescription
providerVGSDKAppInboxProviderThe CleverTap app-inbox provider.
欄位型別說明
providerVGSDKAppInboxProviderCleverTap 應用程式收件匣供應商。
字段类型描述
providerVGSDKAppInboxProviderCleverTap 应用收件箱提供方。

Output

輸出

输出

FieldTypeDescription
valueVGSDKAppInboxListenerThe tapped message, its content, and any CTA button payload.
errorErrorPresent on failure.
欄位型別說明
valueVGSDKAppInboxListener被點擊的訊息、其內容,以及任何 CTA 負載。
errorError失敗時存在。
字段类型描述
valueVGSDKAppInboxListener被点击的消息、其内容以及任何 CTA 负载。
errorError失败时存在。

Apollo

Set the game context

AndroidiOS

Registers 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

輸入

输入

FieldTypeDescription
contextVGSDKGameContextWrapper describing the active session.
context.RoleIdstringActive character/role id (must be non-empty).
context.ServerIdstringActive server id (must be non-empty).
欄位型別說明
contextVGSDKGameContext描述目前工作階段的包裝物件。
context.RoleIdstring目前的角色 id(不得為空)。
context.ServerIdstring目前的伺服器 id(不得為空)。
字段类型描述
contextVGSDKGameContext描述当前会话的包装对象。
context.RoleIdstring当前的角色 id(不得为空)。
context.ServerIdstring当前的服务器 id(不得为空)。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

AndroidiOS

Registers 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

輸入

输入

FieldTypeDescription
listenerAction<string>The listener to register (pass none to clear it).
欄位型別說明
listenerAction<string>要註冊的監聽器(傳入無則清除)。
字段类型描述
listenerAction<string>要注册的监听器(传入无则清除)。

Output

輸出

输出

No return value (fire-and-forget).

無回傳值(fire-and-forget)。

无返回值(fire-and-forget)。

Show the app inbox floating button

AndroidiOS

Displays 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

AndroidiOS

Removes 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

AndroidiOS

Fetches 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

輸出

输出

FieldTypeDescription
valuestringAll remote-config keys and values.
errorErrorPresent 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).
欄位型別說明
valuestring所有遠端設定的鍵與值。
errorError失敗時存在: 缺少 Firebase 相依套件時為 VGSDK firebaseUnsupported(9047。請參閱 一般錯誤碼),否則為原生 Firebase Remote Config 錯誤(fetch/activate 失敗)。
字段类型描述
valuestring所有远程配置的键与值。
errorError失败时存在: 缺少 Firebase 依赖时为 VGSDK firebaseUnsupported(9047。请参阅 通用错误码),否则为原生 Firebase Remote Config 错误(fetch/activate 失败)。

In-App WebView

Show in-app WebView

AndroidiOS

Opens 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

輸入

输入

FieldTypeDescription
urlstringURL to load.
欄位型別說明
urlstring要載入的 URL。
字段类型描述
urlstring要加载的 URL。

Output

輸出

输出

FieldTypeDescription
valuestringFires when the WebView is dismissed.
errorErrorFailed to open the WebView: an Error wrapping a message string (no VGSDK code).
欄位型別說明
valuestring當 WebView 關閉時觸發。
errorError開啟 WebView 失敗: 一個包裝訊息字串的 Error(無 VGSDK 代碼)。
字段类型描述
valuestring当 WebView 关闭时触发。
errorError打开 WebView 失败: 一个包装消息字符串的 Error(无 VGSDK 代码)。

Notification

Add a custom sound

Deliver a custom sound with push notifications: no API call, just a build-time asset drop:

  1. 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.
  2. Copy the file(s) into Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/: directly in sound/.
  3. Build normally for Android or iOS: no script changes. The post-build processor copies the file automatically.
  4. Reference the sound in your push / notification payload, per platform:
    • Android: by resource name (filename without extension), e.g. my_notification for my_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).

為推播通知提供自訂音效:無需 API 呼叫,只是建置時的資源放置:

  1. 準備你的音效檔案:為每個要發佈的平台提供合適格式的音訊檔案。若一個檔名同時滿足兩個平台的規則,也可通用於兩個平台。
  2. 將檔案複製Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/,直接放在 sound/ 目錄下。
  3. 正常建置 Android 或 iOS:無需修改任何指令碼,建置後處理器會自動複製檔案。
  4. 引用該音效:於你的推播 / 通知負載中依平台慣例引用:
    • Android:透過資源名稱(去除副檔名的檔名)引用,例如 my_notification.mp3my_notification。副檔名:.mp3 / .wav / .ogg。保持為簡短提示音。檔名只能是小寫字母、數字與底線([a-z0-9_])。
    • iOS:透過完整檔名(含副檔名)引用,例如 my_notification.caf。副檔名:.caf / .aiff / .wav。最長 30 秒。超過則回退為系統預設音效。

为推送通知提供自定义声音:无需 API 调用,只是构建时的资源放置:

  1. 准备你的声音文件:为每个要发布的平台提供合适格式的音频文件。如果一个文件名同时满足两个平台的规则,也可以通用于两个平台。
  2. 将文件复制Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/,直接放在 sound/ 目录下。
  3. 正常构建 Android 或 iOS:无需修改任何脚本,构建后处理器会自动复制文件。
  4. 引用该声音:在你的推送 / 通知负载中按平台约定引用:
    • Android:通过资源名(去掉扩展名的文件名)引用,例如 my_notification.mp3my_notification。扩展名:.mp3 / .wav / .ogg。保持为简短提示音。文件名只能是小写字母、数字和下划线([a-z0-9_])。
    • iOS:通过完整文件名(含扩展名)引用,例如 my_notification.caf。扩展名:.caf / .aiff / .wav。最长 30 秒。超过则回退为系统默认声音。

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

AndroidiOS

Returns 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

輸出

输出

FieldTypeDescription
valuePassSocialProfileThe Facebook profile. Fields: PassSocialProfile.
errorErrorPresent on failure: the raw native Facebook error (login or Graph request), or undefined (9000) on an invalid access token. See General error codes.
欄位型別說明
valuePassSocialProfileFacebook 個人檔案。欄位:PassSocialProfile
errorError失敗時存在: 原生 Facebook 錯誤(登入或 Graph 請求),或存取權杖無效時為 undefined(9000)。請參閱 一般錯誤碼
字段类型描述
valuePassSocialProfileFacebook 资料。字段:PassSocialProfile
errorError失败时存在: 原生 Facebook 错误(登录或 Graph 请求),或访问令牌无效时为 undefined(9000)。请参阅 通用错误码

Get Facebook friends

AndroidiOS

Returns 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

輸入

输入

FieldTypeDescription
offsetintPaging offset.
countintNumber of friends to fetch.
欄位型別說明
offsetint分頁偏移量。
countint要取得的好友數量。
字段类型描述
offsetint分页偏移量。
countint要获取的好友数量。

Output

輸出

输出

FieldTypeDescription
valuePassSocialFriendslist: PassSocialProfile[]: the player’s Facebook friends. Fields: PassSocialProfile.
errorErrorPresent 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).
欄位型別說明
valuePassSocialFriendslist:PassSocialProfile[]:玩家的 Facebook 好友。欄位:PassSocialProfile
errorError失敗時存在: 原生 Facebook 錯誤(登入或 Graph 請求),或玩家取消重新登入時為 cancelLogin(9003)。請參閱 一般錯誤碼。與「取得 Facebook 個人檔案」不同,存取權杖無效不會對應為 undefined(9000)。
字段类型描述
valuePassSocialFriendslist:PassSocialProfile[]:玩家的 Facebook 好友。字段:PassSocialProfile
errorError失败时存在: 原生 Facebook 错误(登录或 Graph 请求),或玩家取消重新登录时为 cancelLogin(9003)。请参阅 通用错误码。与“获取 Facebook 资料”不同,访问令牌无效不会映射为 undefined(9000)。

Invite Facebook friends

AndroidiOS

Opens the Facebook invite dialog.

開啟 Facebook 邀請對話框。

打开 Facebook 邀请对话框。

PassSDK.Instance.FacebookInviteFriends("Join me!", "Play together", "", 0, result =>
{
    result.Match(_ => { /* invite sent */ }, error => { /* canceled/failed */ });
});

Input

輸入

输入

FieldTypeDescription
titlestringDialog title.
messagestringInvite message shown in the dialog.
recipientsstringRecipient ids (reserved, not forwarded to native).
typeintInvitable-friend filter: 0 = all friends, 1 = app users (friends who use the app), 2 = non-app users.
欄位型別說明
titlestring對話框標題。
messagestring在對話框中顯示的邀請訊息。
recipientsstring接收者 id(保留。不會轉發至原生層)。
typeint可邀請好友篩選: 0 = 所有好友,1 = 使用該應用的好友,2 = 未使用該應用的好友。
字段类型描述
titlestring对话框标题。
messagestring在对话框中显示的邀请消息。
recipientsstring接收者 id(保留。不会转发至原生层)。
typeint可邀请好友筛选: 0 = 所有好友,1 = 使用该应用的好友,2 = 未使用该应用的好友。

Output

輸出

输出

FieldTypeDescription
valuestringInvite result.
errorErrorPresent 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).
欄位型別說明
valuestring邀請結果。
errorError失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。
字段类型描述
valuestring邀请结果。
errorError失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。

Share photo to Facebook

AndroidiOS

Shares a photo through the Facebook share dialog.

透過 Facebook 分享對話框分享相片。

通过 Facebook 分享对话框分享一张照片。

PassSDK.Instance.FacebookSharePhoto(imagePathOrBase64, "My caption", result =>
{
    result.Match(_ => { /* shared */ }, error => { /* canceled/failed */ });
});

Input

輸入

输入

FieldTypeDescription
imagestringImage to share, as a base64-encoded string.
captionstringCaption for the shared photo.
欄位型別說明
imagestring要分享的圖片,為 base64 編碼字串。
captionstring所分享相片的說明文字。
字段类型描述
imagestring要分享的图片,为 base64 编码字符串。
captionstring所分享照片的说明文字。

Output

輸出

输出

FieldTypeDescription
valuestringShare result.
errorErrorPresent 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).
欄位型別說明
valuestring分享結果。
errorError失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。
字段类型描述
valuestring分享结果。
errorError失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。
AndroidiOS

Shares a link.

分享連結。

分享一个链接。

PassSDK.Instance.FacebookShareLink(
    "https://yourgame.com", "Title", "https://yourgame.com/img.png", "Description", result =>
{
    result.Match(_ => { /* shared */ }, error => { /* canceled/failed */ });
});

Input

輸入

输入

FieldTypeDescription
urlstringLink URL to share.
titlestringLink title.
imageUrlstringPreview image URL.
desstringLink description.
欄位型別說明
urlstring要分享的連結 URL。
titlestring連結標題。
imageUrlstring預覽圖片 URL。
desstring連結描述。
字段类型描述
urlstring要分享的链接 URL。
titlestring链接标题。
imageUrlstring预览图片 URL。
desstring链接描述。

Output

輸出

输出

FieldTypeDescription
valuestringShare result.
errorErrorPresent 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).
欄位型別說明
valuestring分享結果。
errorError失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。
字段类型描述
valuestring分享结果。
errorError失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。

Share to Instagram feed

AndroidiOS

Shares an image to the Instagram feed.

將圖片分享到 Instagram 動態。

将一张图片分享到 Instagram 动态。

PassSDK.Instance.InstagramShareFeed(imagePathOrBase64, result =>
{
    result.Match(_ => { /* shared */ }, error => { /* app not installed / failed */ });
});

Input

輸入

输入

FieldTypeDescription
imagestringImage to share, as a base64-encoded string.
欄位型別說明
imagestring要分享的圖片,為 base64 編碼字串。
字段类型描述
imagestring要分享的图片,为 base64 编码字符串。

Output

輸出

输出

FieldTypeDescription
valuestringShare result.
errorErrorPresent on failure, absent means success: see Social error codes.
欄位型別說明
valuestring分享結果。
errorError失敗時存在。不存在表示成功: 請參閱 社群錯誤碼
字段类型描述
valuestring分享结果。
errorError失败时存在。不存在表示成功: 请参阅 社交错误码

Share to Instagram Stories

AndroidiOS

Shares an image to Instagram Stories.

將圖片分享到 Instagram 限時動態。

将一张图片分享到 Instagram 快拍。

PassSDK.Instance.InstagramShareStories(imagePathOrBase64, result =>
{
    result.Match(_ => { /* shared */ }, error => { /* app not installed / failed */ });
});

Input

輸入

输入

FieldTypeDescription
imagestringImage to share, as a base64-encoded string.
欄位型別說明
imagestring要分享的圖片,為 base64 編碼字串。
字段类型描述
imagestring要分享的图片,为 base64 编码字符串。

Output

輸出

输出

FieldTypeDescription
valuestringShare result.
errorErrorPresent on failure, absent means success: see Social error codes. A missing Facebook app id surfaces as facebookConfigNotFound (9020, see General error codes).
欄位型別說明
valuestring分享結果。
errorError失敗時存在。不存在表示成功: 請參閱 社群錯誤碼。缺少 Facebook app id 時為 facebookConfigNotFound(9020。請參閱 一般錯誤碼)。
字段类型描述
valuestring分享结果。
errorError失败时存在。不存在表示成功: 请参阅 社交错误码。缺少 Facebook app id 时为 facebookConfigNotFound(9020。请参阅 通用错误码)。

User Experience

Native store rating prompt and in-chat Google Translate.

原生商店評分提示與聊天內的 Google Translate。

原生商店评分提示,以及聊天内的 Google Translate。

Store rating (in-app review)

AndroidiOS

Triggers 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

AndroidiOS

Translates 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

輸入

输入

FieldTypeDescription
textstringText to translate.
languagestringTarget language code (e.g. “vi”).
欄位型別說明
textstring要翻譯的文字。
languagestring目標語言代碼(例如 “vi”)。
字段类型描述
textstring要翻译的文本。
languagestring目标语言代码(例如 “vi”)。

Output

輸出

输出

FieldTypeDescription
valuestringThe translated text.
errorErrorPresent on failure.
欄位型別說明
valuestring翻譯後的文字。
errorError失敗時存在。
字段类型描述
valuestring翻译后的文本。
errorError失败时存在。

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

AndroidiOS

Returns the SDK’s active language code.

傳回 SDK 使用中的語言代碼。

返回 SDK 的当前语言代码。

string language = PassSDK.Instance.GetCurrentLanguage();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
valuestringActive language code (e.g. “vi”, “en”).
欄位型別說明
valuestring使用中的語言代碼(例如 “vi”、“en”)。
字段类型描述
valuestring当前语言代码(例如 “vi”、“en”)。

Get current user

AndroidiOS

Returns 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

輸出

输出

FieldTypeDescription
valuePassUserInfoThe signed-in user, or absent when no session exists. Fields: PassUserInfo.
errorErrorPresent when no session exists.
欄位型別說明
valuePassUserInfo已登入的使用者。沒有工作階段時不存在。欄位詳見 PassUserInfo
errorError沒有工作階段時存在。
字段类型描述
valuePassUserInfo已登录的用户。没有会话时不存在。字段详见 PassUserInfo
errorError没有会话时存在。

Get current country code

AndroidiOS

Returns 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

輸出

输出

FieldTypeDescription
valuestringThe player’s country code, or OT (other) when outside the game’s publish market. Absent when not yet detected.
欄位型別說明
valuestring玩家的國家/地區代碼。位於遊戲發行市場之外時為 OT(其他)。尚未偵測到時不存在。
字段类型描述
valuestring玩家的国家 / 地区代码。位于游戏发行市场之外时为 OT(其他)。尚未检测到时不存在。

Get device id

AndroidiOS

Returns 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

輸出

输出

FieldTypeDescription
valuestringAdvertising id when available, otherwise a fallback device id, with dashes replaced by underscores. Absent when unavailable.
欄位型別說明
valuestring可用時為廣告識別碼。否則為備用裝置識別碼,連字號會以底線取代。無法取得時不存在。
字段类型描述
valuestring可用时为广告标识符。否则为备用设备标识符,连字符会替换为下划线。无法获取时不存在。

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

欄位

字段

FieldTypeDescription
UserIdstringUnique VNGGames user id.
DisplayNamestringPlayer display name.
SessionIdstringSession token used to authenticate backend calls.
LoginChannelLoginChannelLogin channel: see LoginChannel.
LoginChannelStringstringThe login channel as a string.
ProtectedStatusboolWhether the account is protected/secured.
LastUpdateSessiondoubleEpoch seconds of the last session refresh.
欄位型別說明
UserIdstringVNGGames 唯一使用者 ID。
DisplayNamestring玩家顯示名稱。
SessionIdstring用於驗證後端呼叫的工作階段權杖。
LoginChannelLoginChannel登入頻道: 請參閱 LoginChannel
LoginChannelStringstring以字串表示的登入頻道。
ProtectedStatusbool帳號是否受保護/已加固。
LastUpdateSessiondouble上次工作階段重新整理的 Epoch 秒數。
字段类型描述
UserIdstring唯一的 VNGGames 用户 id。
DisplayNamestring玩家显示名称。
SessionIdstring用于验证后端调用的会话令牌。
LoginChannelLoginChannel登录渠道: 请参阅 LoginChannel
LoginChannelStringstring以字符串表示的登录渠道。
ProtectedStatusbool账号是否受保护 / 已加固。
LastUpdateSessiondouble最近一次会话刷新的 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

欄位

字段

FieldTypeDescription
Facebook1Facebook.
Google3Google.
ZingID4Zing ID.
Guest5Anonymous guest.
Apple7Sign in with Apple.
Email8Email.
欄位型別說明
Facebook1Facebook。
Google3Google。
ZingID4Zing ID。
Guest5匿名訪客。
Apple7使用 Apple 登入。
Email8電子郵件。
字段类型描述
Facebook1Facebook。
Google3Google。
ZingID4Zing ID。
Guest5匿名访客。
Apple7Sign in with Apple。
Email8电子邮箱。

VGSDKManageAccountAction

The action the player took on the account-management screen (int enum), delivered on VGSDKManageAccount.Action.

玩家在帳號管理畫面上採取的動作(int 列舉),透過 VGSDKManageAccount.Action 傳回。

玩家在账号管理界面上采取的操作(int 枚举),通过 VGSDKManageAccount.Action 返回。

Fields

欄位

字段

FieldTypeDescription
Unknown-1Unknown / no action.
Closed0Closed the screen without acting.
AccountBound1Bound / linked an account.
AccountSwitched2Switched to another account.
AccountDeleted3Chose to delete the account.
欄位型別說明
Unknown-1未知/無動作。
Closed0未執行任何操作即關閉畫面。
AccountBound1綁定/連結了帳號。
AccountSwitched2切換到另一個帳號。
AccountDeleted3選擇刪除帳號。
字段类型描述
Unknown-1未知/无操作。
Closed0未执行任何操作即关闭屏幕。
AccountBound1绑定/关联了账号。
AccountSwitched2切换到另一个账号。
AccountDeleted3选择删除账号。

RewardedVideoStatus

ironSource rewarded-video ad/reward lifecycle event (Int enum), delivered on PassISRewardVideo.RewardedVideoStatus.

ironSource 獎勵影片廣告/獎勵生命週期事件(Int 列舉),透過 PassISRewardVideo.RewardedVideoStatus 傳回。

ironSource 激励视频广告/奖励生命周期事件(Int 枚举),通过 PassISRewardVideo.RewardedVideoStatus 返回。

Fields

欄位

字段

FieldTypeDescription
adAvailable0An ad is available.
adUnavailable1No ad available.
adOpened2Ad opened.
adShowFailed3Ad failed to show: carries the underlying ironSource error (its native code, not a VGSDK code).
adClicked4Ad clicked.
adRewarded5Reward earned: grant it here.
adClosed6Ad closed.
onComplete7The rewarded-video operation completed.
欄位型別說明
adAvailable0有可用的廣告。
adUnavailable1沒有可用的廣告。
adOpened2廣告已開啟。
adShowFailed3廣告顯示失敗: 帶有底層的 ironSource 錯誤(其原生代碼,非 VGSDK 代碼)。
adClicked4廣告被點擊。
adRewarded5獲得的獎勵: 在此發放。
adClosed6廣告已關閉。
onComplete7獎勵影片操作已完成。
字段类型描述
adAvailable0有可用的广告。
adUnavailable1没有可用的广告。
adOpened2广告已打开。
adShowFailed3广告展示失败: 携带底层的 ironSource 错误(其原生代码,非 VGSDK 代码)。
adClicked4广告被点击。
adRewarded5获得的奖励: 在此发放。
adClosed6广告已关闭。
onComplete7激励视频操作已完成。

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

欄位

字段

FieldTypeDescription
InterstitialDisplayed0Ad opened.
InterstitialDismissed1Ad closed.
AdLoaded2Ad loaded.
AdClicked3Ad clicked.
LoggingImpression4Impression logged.
InterstitialWillDismissed5About to close.
欄位型別說明
InterstitialDisplayed0廣告已開啟。
InterstitialDismissed1廣告已關閉。
AdLoaded2廣告已載入。
AdClicked3廣告被點擊。
LoggingImpression4已記錄曝光。
InterstitialWillDismissed5即將關閉。
字段类型描述
InterstitialDisplayed0广告已打开。
InterstitialDismissed1广告已关闭。
AdLoaded2广告已加载。
AdClicked3广告被点击。
LoggingImpression4已记录曝光。
InterstitialWillDismissed5即将关闭。

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

欄位

字段

FieldTypeDescription
RewardServerSuccess0The reward server confirmed the reward.
AdLoaded1Ad loaded.
AdClicked2Ad clicked.
LoggingImpression3Impression logged.
RewardedVideoActivityDestroyed4The ad activity was destroyed.
RewardedVideoClosed5Ad closed.
RewardedVideoCompleted6The rewarded video finished.
欄位型別說明
RewardServerSuccess0獎勵伺服器已確認獎勵。
AdLoaded1廣告已載入。
AdClicked2廣告被點擊。
LoggingImpression3已記錄曝光。
RewardedVideoActivityDestroyed4廣告 activity 已銷毀。
RewardedVideoClosed5廣告已關閉。
RewardedVideoCompleted6獎勵影片已結束。
字段类型描述
RewardServerSuccess0奖励服务器已确认奖励。
AdLoaded1广告已加载。
AdClicked2广告被点击。
LoggingImpression3已记录曝光。
RewardedVideoActivityDestroyed4广告 activity 已销毁。
RewardedVideoClosed5广告已关闭。
RewardedVideoCompleted6激励视频已结束。

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

欄位

字段

FieldTypeDescription
RewardServerSuccess0The reward server confirmed the reward.
AdLoaded1Ad loaded.
AdClicked2Ad clicked.
LoggingImpression3Impression logged.
RewardedInterstitialClosed4Ad closed.
RewardedInterstitialCompleted5The rewarded interstitial finished.
RewardedInterstitialWillClosed6About to close.
欄位型別說明
RewardServerSuccess0獎勵伺服器已確認獎勵。
AdLoaded1廣告已載入。
AdClicked2廣告被點擊。
LoggingImpression3已記錄曝光。
RewardedInterstitialClosed4廣告已關閉。
RewardedInterstitialCompleted5獎勵插頁式廣告已結束。
RewardedInterstitialWillClosed6即將關閉。
字段类型描述
RewardServerSuccess0奖励服务器已确认奖励。
AdLoaded1广告已加载。
AdClicked2广告被点击。
LoggingImpression3已记录曝光。
RewardedInterstitialClosed4广告已关闭。
RewardedInterstitialCompleted5激励插屏广告已结束。
RewardedInterstitialWillClosed6即将关闭。

VGSDKPaymentProduct

A sellable product returned by Get products.

由「取得商品」傳回的可販售商品。

由“获取商品”返回的可售卖商品。

Fields

欄位

字段

FieldTypeDescription
ItemIdstringThe configured item id from Store.
PricedoubleNumeric price in the store currency.
PriceMicrosulongPrice in micro-units: 1,000,000 = one currency unit.
DisplayPricestringStore-formatted price string to show the player.
CurrencystringISO currency code.
CurrencySymbolstringCurrency symbol for the price.
欄位型別說明
ItemIdstring在商店設定的商品 id。
Pricedouble以商店貨幣計價的數值價格。
PriceMicrosulong以微單位表示的價格: 1,000,000 = 一個 currency 單位。
DisplayPricestring商店格式化後、用於向玩家顯示的價格字串。
CurrencystringISO 貨幣代碼。
CurrencySymbolstring價格所用的貨幣符號。
字段类型描述
ItemIdstring在商店配置的商品 id。
Pricedouble以商店货币计价的数值价格。
PriceMicrosulong以微单位表示的价格: 1,000,000 = 一个 currency 单位。
DisplayPricestring商店格式化后、用于向玩家展示的价格字符串。
CurrencystringISO 货币代码。
CurrencySymbolstring价格所用的货币符号。

VGSDKAnalyticsProvider

Analytics provider selector for sendCustomEvent (Int enum).

sendCustomEvent 的分析供應商選擇器(Int 列舉)。

sendCustomEvent 的分析提供方选择器(Int 枚举)。

Fields

欄位

字段

FieldTypeDescription
.appsFlyer0AppsFlyer.
.firebase1Firebase Analytics.
.dataPlatform2VNGGames Data Platform.
.facebook3Facebook App Events.
.thinkingData4ThinkingData.
.cleverTap5CleverTap.
欄位型別說明
.appsFlyer0AppsFlyer。
.firebase1Firebase Analytics。
.dataPlatform2VNGGames Data Platform。
.facebook3Facebook App Events。
.thinkingData4ThinkingData。
.cleverTap5CleverTap。
字段类型描述
.appsFlyer0AppsFlyer。
.firebase1Firebase Analytics。
.dataPlatform2VNGGames 数据平台。
.facebook3Facebook App Events。
.thinkingData4ThinkingData。
.cleverTap5CleverTap。

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_infouser_inforesponse_infologin_info 為 JSON 編碼字串。後兩者為條件性: 請參閱其對應列。由 分析 中的每個方法使用。

分析门面合并到它触发的每个事件中的默认参数。SDK 会自动填充它们: 你无需设置。每个方法自身的输入以及你传入的任何 extraData 都会叠加在其之上。device_infouser_inforesponse_infologin_info 是 JSON 编码的字符串。后两个是条件性的: 见其对应行。分析 中的每个方法都会使用它们。

Fields

欄位

字段

FieldTypeDescription
device_infoStringDevice info, JSON-encoded: os (the platform name), version (OS version), model (device model).
device_idStringPer-device id (advertising id when available, otherwise a fallback device id, prefixed).
game_versionStringFull game (app) version.
sdk_versionStringVNGGames SDK version.
packageStringGame bundle id / package name.
network_typeStringActive network type at send time.
timestampStringEvent time, in milliseconds.
session_idStringAnalytics session id: a UUID generated once per app run.
user_infoStringSigned-in user info, JSON-encoded: user_id, social_id, country_code. Ids are empty while signed out.
appsflyer_idStringAppsFlyer device UID.
frb_installation_idStringFirebase installation id.
frb_app_instance_idStringFirebase app-instance id.
response_infoStringAdded only on events that report an outcome. JSON-encoded: status (Success / Failed / Canceled), error_code, remote (0 local, 1 remote).
login_infoStringAdded only on login-flow events. JSON-encoded: method, channel, flow (CreateUser / UpdateUser), step.
欄位型別說明
device_infoString裝置資訊,JSON 編碼:os(平台名稱)、version(作業系統版本)、model(裝置型號)。
device_idString每台裝置的 ID(可用時為廣告 ID,否則為備用裝置 ID。含前綴)。
game_versionString完整的遊戲(應用程式)版本。
sdk_versionStringVNGGames SDK 版本。
packageString遊戲的 bundle id/套件名稱。
network_typeString傳送當下使用中的網路類型。
timestampString事件時間,以毫秒為單位。
session_idString分析工作階段 ID: 每次應用程式執行時產生一次的 UUID。
user_infoString已登入使用者資訊,JSON 編碼:user_idsocial_idcountry_code。登出時這些 ID 為空。
appsflyer_idStringAppsFlyer 裝置 UID。
frb_installation_idStringFirebase 安裝 ID。
frb_app_instance_idStringFirebase 應用程式執行個體 ID。
response_infoString僅在回報結果的事件上加入。JSON 編碼:statusSuccessFailedCanceled)、error_coderemote0 本機、1 遠端)。
login_infoString僅在登入流程事件上加入。JSON 編碼:methodchannelflowCreateUserUpdateUser)、step
字段类型描述
device_infoString设备信息,JSON 编码:os(平台名称)、version(操作系统版本)、model(设备型号)。
device_idString每设备 id(可用时为广告 id,否则为备用设备 id。带前缀)。
game_versionString完整的游戏(应用)版本。
sdk_versionStringVNGGames SDK 版本。
packageString游戏 bundle id / 包名。
network_typeString发送时的当前网络类型。
timestampString事件时间,以毫秒为单位。
session_idString分析会话 id: 每次应用运行生成一次的 UUID。
user_infoString已登录用户信息,JSON 编码:user_idsocial_idcountry_code。未登录时这些 id 为空。
appsflyer_idStringAppsFlyer 设备 UID。
frb_installation_idStringFirebase 安装 id。
frb_app_instance_idStringFirebase 应用实例 id。
response_infoString仅在报告结果的事件上添加。JSON 编码:statusSuccess / Failed / Canceled)、error_coderemote0 本地,1 远程)。
login_infoString仅在登录流程事件上添加。JSON 编码:methodchannelflowCreateUser / 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

欄位

字段

FieldTypeDescription
FirebasefrbFirebase Analytics.
FacebookfbFacebook App Events.
AppsFlyerafAppsFlyer.
Data PlatformdpVNGGames Data Platform.
CleverTapcltCleverTap.
ThinkingDatatdThinkingData.
欄位型別說明
FirebasefrbFirebase Analytics。
FacebookfbFacebook App Events。
AppsFlyerafAppsFlyer。
Data PlatformdpVNGGames Data Platform。
CleverTapcltCleverTap。
ThinkingDatatdThinkingData。
字段类型描述
FirebasefrbFirebase Analytics。
FacebookfbFacebook App Events。
AppsFlyerafAppsFlyer。
Data PlatformdpVNGGames 数据平台。
CleverTapcltCleverTap。
ThinkingDatatdThinkingData。

Ad revenue mediation network

Mediation network for ad-revenue reporting (UInt enum), used by miscAdRevenue.

用於廣告收益回報的中介聯播網(UInt 列舉),由 miscAdRevenue 使用。

用于广告收入上报的聚合网络(UInt 枚举),由 miscAdRevenue 使用。

Fields

欄位

字段

FieldTypeDescription
.googleAdMob1Google AdMob.
.ironSource2ironSource.
.applovinMax3AppLovin MAX.
.fyber4Fyber.
.appodeal5Appodeal.
.admost6Admost.
.topon7TopOn.
.tradplus8TradPlus.
.yandex9Yandex.
.chartBoost10Chartboost.
.unity11Unity Ads.
.custom12Custom.
.directMonetization13Direct monetization.
欄位型別說明
.googleAdMob1Google AdMob。
.ironSource2ironSource。
.applovinMax3AppLovin MAX。
.fyber4Fyber。
.appodeal5Appodeal。
.admost6Admost。
.topon7TopOn。
.tradplus8TradPlus。
.yandex9Yandex。
.chartBoost10Chartboost。
.unity11Unity Ads。
.custom12自訂。
.directMonetization13直接營利。
字段类型描述
.googleAdMob1Google AdMob。
.ironSource2ironSource。
.applovinMax3AppLovin MAX。
.fyber4Fyber。
.appodeal5Appodeal。
.admost6Admost。
.topon7TopOn。
.tradplus8TradPlus。
.yandex9Yandex。
.chartBoost10Chartboost。
.unity11Unity Ads。
.custom12自定义。
.directMonetization13直接变现。

PassSocialProfile

A social profile returned by the Facebook profile/friends methods.

由 Facebook 個人檔案/好友方法傳回的社群個人檔案。

由 Facebook 资料/好友方法返回的社交资料。

Fields

欄位

字段

FieldTypeDescription
userIdstringVNGGames/Facebook user id.
namestringDisplay name.
avatarUrlstringProfile picture URL.
欄位型別說明
userIdstringVNGGames/Facebook 使用者 id。
namestring顯示名稱。
avatarUrlstring個人檔案圖片 URL。
字段类型描述
userIdstringVNGGames/Facebook 用户 id。
namestring显示名称。
avatarUrlstring头像图片 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.sdkPassError)的错误形式返回,按来源分段。每一行是一个错误码: 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_CANCELlegacy 建置風味在其取消登入路徑回報 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_CANCELlegacy 构建风味在其取消登录路径返回 9003),7003 为 LOGIN_FAILED,而 7021 为账号已绑定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 则以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,并定义了 Android 没有的 7022 至 7027(未返回结果与快速登录的情形)。

Codes

錯誤碼

错误码

FieldTypeDescription
7000undefinedUnmapped GGID / OAuth error (fallback).
7001cancelLoginPlayer canceled login.
7005invalidRequestOAuth invalid_request.
7006invalidClientOAuth invalid_client.
7007invalidGrantOAuth invalid_grant.
7008invalidScopeOAuth invalid_scope.
7009unsupportedResponseTypeOAuth unsupported_response_type.
7010unsupportedGrantTypeOAuth unsupported_grant_type.
7011unauthorizedClientOAuth unauthorized_client.
7012unauthorizedCodeOAuth unauthorized_code.
7013unauthorizedTokenOAuth unauthorized_token.
7014expiredAccessTokenAccess token expired.
7015expiredRefreshTokenRefresh token expired.
7016inactiveAccessTokenAccess token inactive.
7017accessDeniedAccess denied.
7018serverErrorOAuth server_error.
7019internalErrorOAuth internal_error.
7020invalidUserCredentialsInvalid user credentials.
7021validateAccessTokenNullResultiOS: token validation returned no result. On Android, 7021 is QUICK_LOGIN_ACCOUNT_BOUND (see the platform note above).
7022refreshAccessTokenNullResultToken refresh returned no result.
7023getProfileNullResultProfile fetch returned no result.
7024authenticateNullResultAuthentication returned no result.
7025quickLoginAccountBoundiOS only: the guest account is already bound to a VGA account. Android maps this case to 7021.
7026quickLoginRequiredBindingBinding is required: the user must bind their account (no skip option).
7027quickLoginTurnOffQuick login is disabled. The standard login options are shown instead.
欄位型別說明
7000undefined未對應的 GGID/OAuth 錯誤(備用)。
7001cancelLogin玩家取消登入。
7005invalidRequestOAuth invalid_request。
7006invalidClientOAuth invalid_client。
7007invalidGrantOAuth invalid_grant。
7008invalidScopeOAuth invalid_scope。
7009unsupportedResponseTypeOAuth unsupported_response_type。
7010unsupportedGrantTypeOAuth unsupported_grant_type。
7011unauthorizedClientOAuth unauthorized_client。
7012unauthorizedCodeOAuth unauthorized_code。
7013unauthorizedTokenOAuth unauthorized_token。
7014expiredAccessToken存取權杖已過期。
7015expiredRefreshToken重新整理權杖已過期。
7016inactiveAccessToken存取權杖未啟用。
7017accessDenied存取遭拒。
7018serverErrorOAuth server_error。
7019internalErrorOAuth internal_error。
7020invalidUserCredentials使用者憑證無效。
7021validateAccessTokenNullResultiOS: 權杖驗證未傳回任何結果。在 Android 上,7021 為 QUICK_LOGIN_ACCOUNT_BOUND(見上方平台說明)。
7022refreshAccessTokenNullResult權杖重新整理未傳回任何結果。
7023getProfileNullResult個人檔案取得未傳回任何結果。
7024authenticateNullResult身分驗證未傳回任何結果。
7025quickLoginAccountBound僅 iOS: 此訪客帳號已綁定到某個 VGA 帳號。Android 將此情形對應為 7021。
7026quickLoginRequiredBinding必須綁定: 使用者必須綁定其帳號(無略過選項)。
7027quickLoginTurnOff快速登入已停用。改為顯示標準登入選項。
字段类型描述
7000undefined未映射的 GGID / OAuth 错误(兜底)。
7001cancelLogin玩家取消了登录。
7005invalidRequestOAuth invalid_request 错误。
7006invalidClientOAuth invalid_client 错误。
7007invalidGrantOAuth invalid_grant 错误。
7008invalidScopeOAuth invalid_scope 错误。
7009unsupportedResponseTypeOAuth unsupported_response_type 错误。
7010unsupportedGrantTypeOAuth unsupported_grant_type 错误。
7011unauthorizedClientOAuth unauthorized_client 错误。
7012unauthorizedCodeOAuth unauthorized_code 错误。
7013unauthorizedTokenOAuth unauthorized_token 错误。
7014expiredAccessToken访问令牌已过期。
7015expiredRefreshToken刷新令牌已过期。
7016inactiveAccessToken访问令牌未激活。
7017accessDenied访问被拒绝。
7018serverErrorOAuth server_error。
7019internalErrorOAuth internal_error。
7020invalidUserCredentials用户凭据无效。
7021validateAccessTokenNullResultiOS: 令牌验证未返回结果。在 Android 上,7021 为 QUICK_LOGIN_ACCOUNT_BOUND(见上方平台说明)。
7022refreshAccessTokenNullResult令牌刷新未返回结果。
7023getProfileNullResult资料获取未返回结果。
7024authenticateNullResult身份验证未返回结果。
7025quickLoginAccountBound仅 iOS: 该访客账号已绑定到某个 VGA 账号。Android 将此情形映射为 7021。
7026quickLoginRequiredBinding必须绑定: 用户必须绑定其账号(无跳过选项)。
7027quickLoginTurnOff快速登录已禁用。改为显示标准登录选项。

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

錯誤碼

错误码

FieldTypeDescription
8000unknownUnknown Passport-legacy login error (fallback).
80011Success (server returned code 1).
8002-500System error: inspect server logs.
8003-404Invalid request (client called the wrong URL).
8004-1Bad signature.
8005-2Bad request parameters.
8006-101Email is already registered.
8007-102Email already in use (guest protection).
8008-103Email does not exist (forgot / reset password).
8009-104UserID is already protected.
8010-105UserID not found (account disabled / deleted).
8011-106Invalid login credentials.
8012-107Invalid login credentials (profile mismatch / null).
8013-108Invalid or expired session.
8014-109Under the minimum age allowed to play.
8015-110Account initialization failed.
8016-111User is not in the early-access allow list.
8017-112Account is locked.
8018-113Account profile is incomplete.
欄位型別說明
8000unknown未知的 Passport legacy 登入錯誤(備用)。
80011成功(伺服器回傳碼 1)。
8002-500系統錯誤: 請檢查伺服器記錄。
8003-404無效的請求(用戶端呼叫了錯誤的 URL)。
8004-1簽章錯誤。
8005-2請求參數錯誤。
8006-101電子郵件已註冊。
8007-102電子郵件已被使用(訪客保護)。
8008-103電子郵件不存在(忘記/重設密碼)。
8009-104UserID 已受保護。
8010-105找不到 UserID(帳號已停用/已刪除)。
8011-106登入憑證無效。
8012-107登入憑證無效(個人檔案不符/為 null)。
8013-108工作階段無效或已過期。
8014-109未達允許遊玩的最低年齡。
8015-110帳號初始化失敗。
8016-111使用者不在搶先體驗的允許清單中。
8017-112帳號已鎖定。
8018-113帳號個人檔案不完整。
字段类型描述
8000unknown未知的 Passport 旧版登录错误(兜底)。
80011成功(服务器返回码 1)。
8002-500系统错误: 请检查服务器日志。
8003-404请求无效(客户端调用了错误的 URL)。
8004-1签名错误。
8005-2请求参数错误。
8006-101邮箱已被注册。
8007-102邮箱已被使用(访客保护)。
8008-103邮箱不存在(忘记 / 重置密码)。
8009-104UserID 已受保护。
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

錯誤碼

错误码

FieldTypeDescription
6000unknownUnknown billing-server error (fallback).
60011Success (server returned code 1).
6002-8System under maintenance (any payment-system error maps here).
6003-70Payment error (uncategorized IAP pay failure).
6004-71Invalid receipt (bad signature or mismatched package / product / order).
6005-72Duplicate receipt (already verified successfully).
6006-73Expired receipt (older than 72 hours).
欄位型別說明
6000unknown未知的帳務伺服器錯誤(備用)。
60011成功(伺服器回傳碼 1)。
6002-8系統維護中(任何付款系統錯誤都對應到此)。
6003-70付款錯誤(未分類的 IAP 付款失敗)。
6004-71收據無效(簽章錯誤或 package/product/order 不符)。
6005-72重複的收據(已成功驗證過)。
6006-73收據已過期(超過 72 小時)。
字段类型描述
6000unknown未知的计费服务器错误(兜底)。
60011成功(服务器返回码 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

錯誤碼

错误码

FieldTypeDescription
9006paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEMiOS: the purchase info is invalid. Android: product not found on the pre-purchase inventory check.
9007paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEMProduct id not found.
9008paymentVerificationInProgress / ITEM_IS_VERIFYINGA verification is already in progress.
9009paymentCanceled / PAYMENT_CANCELPlayer canceled the purchase.
9010NOT_SIGN_IN_GOOGLE_PLAYAndroid: the player is not signed in to Google Play.
9011NOT_REGISTER_ITEMAndroid: the item / reward package is not registered.
9012HAS_SUBSCRIPTIONAndroid: the player already owns an active subscription for this item.
9013PRODUCT_IS_PENDINGAndroid: the purchase is pending (not yet completed).
9014PURCHASE_FAILED_WITH_BILLING_ERRORAndroid: purchase failed due to a Google Play billing error.
9015PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LISTAndroid: purchase failed. The returned purchase list did not contain the item.
9016paymentRetrieveAppleReceiptFailediOS: could not read the App Store receipt.
9017paymentOrderDataInvalidiOS: the order data is invalid.
9049paymentPendingiOS: the purchase is pending approval (deferred / Ask-to-Buy).
欄位型別說明
9006paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEMiOS: 購買資訊無效。Android: 購買前查詢庫存時找不到該商品。
9007paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM找不到商品 ID。
9008paymentVerificationInProgress / ITEM_IS_VERIFYING已有一項驗證正在進行中。
9009paymentCanceled / PAYMENT_CANCEL玩家取消了購買。
9010NOT_SIGN_IN_GOOGLE_PLAYAndroid: 尚未登入 Google Play。
9011NOT_REGISTER_ITEMAndroid: 道具/獎勵包未註冊。
9012HAS_SUBSCRIPTIONAndroid: 已擁有此項目的有效訂閱。
9013PRODUCT_IS_PENDINGAndroid: 購買處於待處理狀態(尚未完成)。
9014PURCHASE_FAILED_WITH_BILLING_ERRORAndroid: 因 Google Play 帳務錯誤導致購買失敗。
9015PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LISTAndroid: 購買失敗。回傳的購買清單未包含該項目。
9016paymentRetrieveAppleReceiptFailediOS: 無法讀取 App Store 收據。
9017paymentOrderDataInvalidiOS: 訂單資料無效。
9049paymentPendingiOS: 購買正等待核准(延遲/需家長同意)。
字段类型描述
9006paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEMiOS: 购买信息无效。Android: 购买前查询库存时找不到该商品。
9007paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM找不到商品 id。
9008paymentVerificationInProgress / ITEM_IS_VERIFYING已有一个验证正在进行中。
9009paymentCanceled / PAYMENT_CANCEL玩家取消了购买。
9010NOT_SIGN_IN_GOOGLE_PLAYAndroid: 尚未登录 Google Play。
9011NOT_REGISTER_ITEMAndroid: 道具 / 奖励包未注册。
9012HAS_SUBSCRIPTIONAndroid: 已拥有此项目的有效订阅。
9013PRODUCT_IS_PENDINGAndroid: 购买处于待处理状态(尚未完成)。
9014PURCHASE_FAILED_WITH_BILLING_ERRORAndroid: 因 Google Play 结算错误导致购买失败。
9015PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LISTAndroid: 购买失败。返回的购买列表未包含该商品。
9016paymentRetrieveAppleReceiptFailediOS: 无法读取 App Store 收据。
9017paymentOrderDataInvalidiOS: 订单数据无效。
9049paymentPendingiOS: 购买正在等待批准(延迟 / 需家长同意)。

Social (9xxx)

Facebook and Instagram profile / share / invite failures.

Facebook 與 Instagram 的個人檔案/分享/邀請失敗。

Facebook 与 Instagram 的资料 / 分享 / 邀请失败。

Codes

錯誤碼

错误码

FieldTypeDescription
9024facebookGetProfileNullResultFacebook profile fetch returned no result.
9026facebookShareEmptyPhotoNo photo supplied to share.
9027facebookAppNotInstalledFacebook app is not installed.
9028facebookShareEmptyLinkNo link supplied to share.
9029facebookInviteFriendTitleAndMessageEmptyInvite title and message are both empty.
9030facebookShareCanceledPlayer canceled the share.
9031facebookInviteFriendCanceledPlayer canceled the invite.
9032instagramAppNotInstalledInstagram app is not installed.
9033instagramPhotoLibraryNotAllowedPhoto-library access not granted.
9034instagramShareEmptyPhotoNo photo supplied to share.
9035facebookUnsupportedFacebook feature not enabled in this build.
9038instagramUnsupportedInstagram feature not enabled in this build.
欄位型別說明
9024facebookGetProfileNullResultFacebook 個人檔案取得未傳回任何結果。
9026facebookShareEmptyPhoto未提供要分享的相片。
9027facebookAppNotInstalled未安裝 Facebook 應用程式。
9028facebookShareEmptyLink未提供要分享的連結。
9029facebookInviteFriendTitleAndMessageEmpty邀請的標題與訊息皆為空。
9030facebookShareCanceled玩家取消了分享。
9031facebookInviteFriendCanceled玩家取消了邀請。
9032instagramAppNotInstalled未安裝 Instagram 應用程式。
9033instagramPhotoLibraryNotAllowed未授予相片庫存取權。
9034instagramShareEmptyPhoto未提供要分享的相片。
9035facebookUnsupported此版本未啟用 Facebook 功能。
9038instagramUnsupported此版本未啟用 Instagram 功能。
字段类型描述
9024facebookGetProfileNullResultFacebook 资料获取未返回结果。
9026facebookShareEmptyPhoto未提供要分享的照片。
9027facebookAppNotInstalled未安装 Facebook 应用。
9028facebookShareEmptyLink未提供要分享的链接。
9029facebookInviteFriendTitleAndMessageEmpty邀请标题和消息均为空。
9030facebookShareCanceled玩家取消了分享。
9031facebookInviteFriendCanceled玩家取消了邀请。
9032instagramAppNotInstalled未安装 Instagram 应用。
9033instagramPhotoLibraryNotAllowed未授予相册访问权限。
9034instagramShareEmptyPhoto未提供要分享的照片。
9035facebookUnsupported此构建版本未启用 Facebook 功能。
9038instagramUnsupported此构建版本未启用 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

錯誤碼

错误码

FieldTypeDescription
9000undefinedUndefined / unknown error.
9001networkFailedNetwork request failed (retryable).
9002wrongDataFormatMalformed response data.
9003cancelLoginLogin canceled (SDK band).
9005googleRefreshTokenFailedGoogle token refresh failed.
9018appleCredentialNotFoundInAuthorizationResultApple authorization returned no credential.
9019googleConfigNotFoundGoogle config missing.
9020facebookConfigNotFoundFacebook config missing.
9021appleTwoAuthenticationErrorSign in with Apple 2FA error.
9022appleCancelErrorPlayer canceled Sign in with Apple.
9023appleOtherErrorOther Sign in with Apple error.
9025appleCachedCredentialNotFoundNo cached Apple credential.
9036googleUnsupportedGoogle login not enabled in this build.
9037vgaUnsupportedVGA login not enabled in this build.
9047firebaseUnsupportedFirebase not enabled in this build.
404featureNotSupportedUnity: the called method is not supported on the current native platform (PassAPI.NotApplicable): e.g. CheckReward / VerifyReward / RequestPermission on iOS, or DeleteAccount on Android.
-1featureDisabledUnity: 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.
欄位型別說明
9000undefined未定義/未知的錯誤。
9001networkFailed網路請求失敗(可重試)。
9002wrongDataFormat回應資料格式錯誤。
9003cancelLogin登入已取消(SDK 分段)。
9005googleRefreshTokenFailedGoogle 權杖重新整理失敗。
9018appleCredentialNotFoundInAuthorizationResultApple 授權未傳回任何憑證。
9019googleConfigNotFound缺少 Google 設定。
9020facebookConfigNotFound缺少 Facebook 設定。
9021appleTwoAuthenticationError使用 Apple 登入的兩階段驗證錯誤。
9022appleCancelError玩家取消了使用 Apple 登入。
9023appleOtherError其他使用 Apple 登入的錯誤。
9025appleCachedCredentialNotFound沒有快取的 Apple 憑證。
9036googleUnsupported此版本未啟用 Google 登入。
9037vgaUnsupported此版本未啟用 VGA 登入。
9047firebaseUnsupported此版本未啟用 Firebase。
404featureNotSupportedUnity: 所呼叫的方法在目前的原生平台上不支援(PassAPI.NotApplicable):例如 iOS 上的 CheckReward/VerifyReward/RequestPermission,或 Android 上的 DeleteAccount。
-1featureDisabledUnity: 該功能的原生框架在建置時未打包(Facebook、StoreKit、IronSource、Meta Audience Network、CleverTap…),或 Meta 廣告獎勵伺服器失敗。
字段类型描述
9000undefined未定义 / 未知错误。
9001networkFailed网络请求失败(可重试)。
9002wrongDataFormat响应数据格式错误。
9003cancelLogin登录已取消(SDK 段)。
9005googleRefreshTokenFailedGoogle 令牌刷新失败。
9018appleCredentialNotFoundInAuthorizationResultApple 授权未返回凭据。
9019googleConfigNotFound缺少 Google 配置。
9020facebookConfigNotFound缺少 Facebook 配置。
9021appleTwoAuthenticationErrorSign in with Apple 双重验证(2FA)错误。
9022appleCancelError玩家取消了 Sign in with Apple。
9023appleOtherError其他 Sign in with Apple 错误。
9025appleCachedCredentialNotFound没有缓存的 Apple 凭据。
9036googleUnsupported此构建版本未启用 Google 登录。
9037vgaUnsupported此构建版本未启用 VGA 登录。
9047firebaseUnsupported此构建版本未启用 Firebase。
404featureNotSupportedUnity: 所调用的方法在当前原生平台上不支持(PassAPI.NotApplicable):例如 iOS 上的 CheckReward / VerifyReward / RequestPermission,或 Android 上的 DeleteAccount。
-1featureDisabledUnity: 该功能的原生框架在构建时未打包(Facebook、StoreKit、IronSource、Meta Audience Network、CleverTap…),或 Meta 广告奖励服务器失败。