Windows 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: the Windows build ships as VNGGamesSDK.dll, the config file vnggamessdk.dat, and the deep-link handler <GameName>_VNGGamesSDK.exe.
  • Platform: 64-bit Windows, with a C/C++ toolchain (MSVC) to load and call the DLL’s extern "C" exports.
  • Per-game config: vnggamessdk.dat (and any runtime-config JSON) is provisioned from the OP Tool.
  • VNGGames SDK 套件:Windows 版本以 VNGGamesSDK.dll、設定檔 vnggamessdk.dat,以及深層連結處理程式 <GameName>_VNGGamesSDK.exe 的形式發佈。
  • 平台:64 位元 Windows,並具備可載入與呼叫該 DLL extern "C" 匯出項的 C/C++ 工具鏈(MSVC)。
  • 各遊戲設定vnggamessdk.dat(以及任何執行環境設定 JSON)由 OP Tool 佈建。
  • VNGGames SDK 包:Windows 版本以 VNGGamesSDK.dll、配置文件 vnggamessdk.dat,以及深度链接处理程序 <GameName>_VNGGamesSDK.exe 的形式发布。
  • 平台:64 位 Windows,并具备可加载与调用该 DLL extern "C" 导出项的 C/C++ 工具链(MSVC)。
  • 每款游戏配置vnggamessdk.dat(以及任何运行时配置 JSON)由 OP Tool 预配。

Dependencies

Every third-party library compiled into VNGGamesSDK.dll. The SDK links them statically, so there is nothing to declare and nothing to reconcile in your own build. The list is here so you can check the version if your game already embeds one of them, CEF above all.

已編譯進 VNGGamesSDK.dll 的所有第三方函式庫。SDK 以靜態方式連結它們,因此你自己的建置中沒有需要宣告或需要調和的項目。列出它們是為了讓你在遊戲已嵌入其中之一(尤其是 CEF)時可以核對版本。

已编译进 VNGGamesSDK.dll 的所有第三方库。SDK 以静态方式链接它们,因此你自己的构建中没有需要声明或需要协调的项目。列出它们是为了让你在游戏已嵌入其中之一(尤其是 CEF)时可以核对版本。

LibraryVersionGroup
cef-prebuilt137.0.17Core
cpr1.12.0Core
wxwebphandler1.0.0Core
wxwidgets3.2.5Core
openssl3.3.2Core
ixwebsocket11.4.5Core
ada-url2.9.1Core
nlohmann-json3.11.3Core
tomlplusplus3.4.0Core
picosha22018-07-30Core
winreg6.3.0Core
bext-di1.3.0Core
spdlog1.14.1Core
fmt11.0.2Core
cpptrace0.7.1Core
thinkingdata-sdk1.4.2Analytics
函式庫版本分組
cef-prebuilt137.0.17核心
cpr1.12.0核心
wxwebphandler1.0.0核心
wxwidgets3.2.5核心
openssl3.3.2核心
ixwebsocket11.4.5核心
ada-url2.9.1核心
nlohmann-json3.11.3核心
tomlplusplus3.4.0核心
picosha22018-07-30核心
winreg6.3.0核心
bext-di1.3.0核心
spdlog1.14.1核心
fmt11.0.2核心
cpptrace0.7.1核心
thinkingdata-sdk1.4.2分析
版本分组
cef-prebuilt137.0.17核心
cpr1.12.0核心
wxwebphandler1.0.0核心
wxwidgets3.2.5核心
openssl3.3.2核心
ixwebsocket11.4.5核心
ada-url2.9.1核心
nlohmann-json3.11.3核心
tomlplusplus3.4.0核心
picosha22018-07-30核心
winreg6.3.0核心
bext-di1.3.0核心
spdlog1.14.1核心
fmt11.0.2核心
cpptrace0.7.1核心
thinkingdata-sdk1.4.2分析

Installation

Ship the VNGGames SDK’s files alongside your game executable (the full set is shown below), then load and configure the library. The embedded WebView runtime (CEF) files (VNGGamesSDK.webview, libcef.dll, the resource paks, and locales/) power the login form and in-app WebView. By default they are resolved next to VNGGamesSDK.dll.

將 VNGGames SDK 的檔案與你的遊戲執行檔放在一起發佈(完整清單如下),然後載入並設定該程式庫。內嵌 WebView 執行環境(CEF)檔案(VNGGamesSDK.webviewlibcef.dll、資源 pak 檔,以及 locales/)支撐登入表單與應用程式內 WebView。預設情況下,這些檔案會在 VNGGamesSDK.dll 旁邊解析。

将 VNGGames SDK 的文件与你的游戏可执行文件放在一起发布(完整清单如下),然后加载并配置该库。内嵌 WebView 运行时(CEF)文件(VNGGamesSDK.webviewlibcef.dll、资源 pak 文件,以及 locales/)支撑登录表单与应用内 WebView。默认情况下,这些文件会在 VNGGamesSDK.dll 旁边解析。

YourGame/
├─ YourGame.exe                 # your game executable
├─ VNGGamesSDK.dll              # VNGGames SDK
├─ vnggamessdk.dat              # per-game config (from the OP Tool); default beside the .exe: custom path via VGSDKConfig_SetConfigPath() before init
├─ <GameName>_VNGGamesSDK.exe   # deep-link handler
├─ VNGGamesSDK.webview          # CEF subprocess helper
├─ libcef.dll                   # CEF runtime
├─ resources.pak
├─ chrome_100_percent.pak
├─ chrome_200_percent.pak
└─ locales/                     # CEF locale data

Add VNGGames SDK library file

Place VNGGamesSDK.dll in your project and ship it next to the game executable (together with vnggamessdk.dat and <GameName>_VNGGamesSDK.exe).

VNGGamesSDK.dll 放入你的專案,並將它與遊戲執行檔一起發佈(連同 vnggamessdk.dat<GameName>_VNGGamesSDK.exe)。

VNGGamesSDK.dll 放入你的项目,并将它与游戏可执行文件一起发布(连同 vnggamessdk.dat<GameName>_VNGGamesSDK.exe)。

Load library and functions

Load the DLL, then resolve its exported extern "C" functions: either with the bundled helper header or your own loader.

載入該 DLL,然後解析它匯出的 extern "C" 函式: 可使用隨附的輔助標頭檔,或使用你自己的載入器。

加载该 DLL,然后解析它导出的 extern "C" 函数: 可使用随附的辅助头文件,或使用你自己的加载器。

HMODULE sdkModule = LoadLibraryW(L"{Your project path}\\VNGGamesSDK.dll");
Approach 1: Use SDK helper file to load functions

Add vnggamessdk.h into your project’s include paths. This header file provides a quick and convenient helper class for loading the functionalities of VNGGames SDK. Use the VNGGamesSDK::SDK helper class as follows:

vnggamessdk.h 加入你專案的 include 路徑。此標頭檔提供一個快速又方便的輔助類別,用來載入 VNGGames SDK 的各項功能。請依下列方式使用 VNGGamesSDK::SDK 輔助類別:

vnggamessdk.h 加入你项目的 include 路径。此头文件提供一个快速又方便的辅助类,用来加载 VNGGames SDK 的各项功能。请按下列方式使用 VNGGamesSDK::SDK 辅助类:

#include "vnggamessdk.h"
 
// other code...
 
// load SDK functions using the VNGGamesSDK::SDK helper class
auto sdk = new VNGGamesSDK::SDK(sdkModule);
 
// use sdk features
Approach 2: Implement your own loading logic

If you don’t want to include vnggamessdk.h in your project, you can still use the file for reference and implement your own loading logic: use the Win32 GetProcAddress API to load functions from the VNGGames SDK DLL.

如果你不想在專案中引入 vnggamessdk.h,仍可將該檔案作為參考並實作你自己的載入邏輯: 使用 Win32 GetProcAddress API 從 VNGGames SDK DLL 載入函式。

如果你不想在项目中引入 vnggamessdk.h,仍可将该文件作为参考并实现你自己的加载逻辑: 使用 Win32 GetProcAddress API 从 VNGGames SDK DLL 加载函数。

The deep-link handler <GameName>_VNGGamesSDK.exe must also be distributed alongside the executable, or login/deep-link callbacks will fail. Once installed and configured, initialize the SDK (see the Initialization section below).

深層連結處理程式 <GameName>_VNGGamesSDK.exe 也必須與執行檔一起發佈,否則登入/深層連結回呼將會失敗。安裝並設定完成後,請初始化 SDK(見下方的 Initialization 章節)。

深度链接处理程序 <GameName>_VNGGamesSDK.exe 也必须与可执行文件一起发布,否则登录/深度链接回调将会失败。安装并配置完成后,请初始化 SDK(见下方的 Initialization 章节)。

Result callbacks & context

Most Windows APIs are asynchronous: the call returns immediately and delivers its result later, on a ResultCallbackCtx you pass. Two consequences you must handle:

  • context must outlive the call. The callback runs after the function has returned, so the void* context you pass has to stay valid until the callback fires: its lifetime must be longer than the function call’s. Never point it at a stack variable that goes out of scope first. Pass nullptr when you have nothing to carry.
  • Free a heap-allocated context. If you allocate the context on the heap (new / malloc), you own it: release it once the callback has run (typically inside the callback, after reading it) so it does not leak.

The callback receives the result as the JSON envelope shown in each method’s Output (success with data, or success:false with an errorCode and errorMessage).

大多數 Windows API 都是非同步的:呼叫會立即返回,稍後才在你傳入的 ResultCallbackCtx 上傳遞結果。有兩個你必須處理的後果:

  • context 的生命週期必須長於該次呼叫。 回呼是在函式返回之後才執行,因此你傳入的 void* context 必須保持有效直到回呼觸發: 它的生命週期必須比該次函式呼叫更長。切勿指向會先離開作用域的堆疊變數。若沒有東西要攜帶,請傳入 nullptr
  • 在堆積上配置的 context 必須釋放。 若你在堆積(heap)上配置 context(new / malloc),它由你擁有: 請在回呼執行完畢後(通常在回呼內部讀取後)釋放它,以免記憶體洩漏。

回呼會以每個方法 Output 中所示的 JSON 封套形式接收結果(successdata,或 success:false 並帶有 errorCodeerrorMessage)。

大多数 Windows API 都是异步的:调用会立即返回,稍后才在你传入的 ResultCallbackCtx 上传递结果。有两个你必须处理的后果:

  • context 的生命周期必须长于该次调用。 回调是在函数返回之后才执行,因此你传入的 void* context 必须保持有效直到回调触发: 它的生命周期必须比该次函数调用更长。切勿指向会先离开作用域的栈变量。若没有东西要携带,请传入 nullptr
  • 在堆上分配的 context 必须释放。 若你在堆(heap)上分配 context(new / malloc),它由你拥有: 请在回调执行完毕后(通常在回调内部读取后)释放它,以免内存泄漏。

回调会以每个方法 Output 中所示的 JSON 封套形式接收结果(successdata,或 success:false 并带有 errorCodeerrorMessage)。

void __stdcall callback(void* context, const char* resultJson) {
    auto* data = static_cast<YourData*>(context);  // recover your typed context
    // ... use data ...
    delete data;  // if you allocated context on the heap
}

Initialization

Initialize the SDK before calling any other feature. On Windows this is an explicit ABI call (InitializeSdkWithConfig). The result is delivered to a callback as the standard JSON envelope, and initialization failures carry a 1xx error code.

在呼叫任何其他功能之前先初始化 SDK。在 Windows 上這是一個明確的 ABI 呼叫(InitializeSdkWithConfig)。結果會透過回呼以標準 JSON 封套傳遞,而初始化失敗會帶有 1xx 錯誤碼。

在调用任何其他功能之前先初始化 SDK。在 Windows 上这是一个显式的 ABI 调用(InitializeSdkWithConfig)。结果会通过回调以标准 JSON 封套传递,而初始化失败会带有 1xx 错误码。

Initialize the SDK

Loads the SDK config and initializes the SDK. Call once at startup, before any other API. Optionally set a custom config path with VGSDKConfig_SetConfigPath first. Failures surface as a 1xx code: see Initialize SDK error codes.

載入 SDK 設定並初始化 SDK。在啟動時呼叫一次,且早於任何其他 API。你也可以先以 VGSDKConfig_SetConfigPath 設定自訂的設定路徑。失敗會以 1xx 錯誤碼呈現: 請參閱 Initialize SDK 錯誤碼

加载 SDK 配置并初始化 SDK。在启动时调用一次,且早于任何其他 API。你也可以先以 VGSDKConfig_SetConfigPath 设置自定义的配置路径。失败会以 1xx 错误码呈现: 请参阅 Initialize SDK 错误码

// runtimeConfigJson OVERRIDES the packaged vnggamessdk.dat: the "general" block:
const char* runtimeConfigJson = R"({
  "general": { "packageName": "com.vng.mygame", "gameVersion": "1.0.0", "maxInstances": 1 }
})";
// optional: call BEFORE init when the .dat is not next to the executable:
// VGSDKConfig_SetConfigPath("C:\\path\\to\\vnggamessdk.dat");
InitializeSdkWithConfig(runtimeConfigJson, callback, /*context*/ nullptr);
// pass nullptr instead of runtimeConfigJson to keep the packaged defaults.

Input

輸入

输入

FieldTypeDescription
runtimeConfigJsonconst char*JSON whose general object OVERRIDES the packaged config (vnggamessdk.dat). Pass nullptr to keep the packaged defaults: an empty or malformed string is NOT a reset, it parses to 102 ConfigParseError. The three keys below all live under general.
generalobjectRequired. The general-settings block. A config with no general object is rejected as a parse error.
general.packageNamestringRequired. The game’s package/bundle name.
general.gameVersionstringRequired. The running game version string.
general.maxInstancesintRequired. Concurrent game-instance cap: ≥ 1 limits running instances to that count, < 1 disables the limiter.
callbackResultCallbackCtxYour result callback: a ResultCallbackCtx, i.e. void(__stdcall*)(void* context, const char* resultJson). The SDK invokes it asynchronously with the result (see Output).
contextvoid*Opaque pointer echoed back to your callback’s context parameter. Pass nullptr if you don’t need it.
欄位型別說明
runtimeConfigJsonconst char*general 物件覆寫封裝設定檔(vnggamessdk.dat)的 JSON。傳入 nullptr 以保留封裝的預設值: 空字串或格式錯誤的字串並非重設,它會被解析為 102 ConfigParseError。下列三個鍵都位於 general 之下。
generalobject必填。一般設定區塊。沒有 general 物件的設定會被視為解析錯誤而遭拒。
general.packageNamestring必填。遊戲的套件/組合(bundle)名稱。
general.gameVersionstring必填。執行中的遊戲版本字串。
general.maxInstancesint必填。同時執行的遊戲實例上限:≥ 1 會將執行中的實例數限制為該數量,< 1 則停用此限制。
callbackResultCallbackCtx你的結果回呼: 一個 ResultCallbackCtx,即 void(__stdcall*)(void* context, const char* resultJson)。SDK 會以非同步方式呼叫它並帶入結果(見 Output)。
contextvoid*會原封不動回傳到你回呼 context 參數的不透明指標。若不需要請傳入 nullptr
字段类型描述
runtimeConfigJsonconst char*general 对象覆盖封装配置文件(vnggamessdk.dat)的 JSON。传入 nullptr 以保留封装的默认值: 空字符串或格式错误的字符串并非重置,它会被解析为 102 ConfigParseError。下列三个键都位于 general 之下。
generalobject必填。常规设置块。没有 general 对象的配置会被视为解析错误而遭拒。
general.packageNamestring必填。游戏的包名(bundle name)。
general.gameVersionstring必填。运行中的游戏版本字符串。
general.maxInstancesint必填。同时运行的游戏实例上限:≥ 1 会将运行中的实例数限制为该数量,< 1 则禁用此限制。
callbackResultCallbackCtx你的结果回调: 一个 ResultCallbackCtx,即 void(__stdcall*)(void* context, const char* resultJson)。SDK 会以异步方式调用它并传入结果(见 Output)。
contextvoid*会原样回传到你回调 context 参数的不透明指针。若不需要请传入 nullptr

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Error Codes.
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 錯誤碼
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 错误码
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

Set game window

Optional, and separate from initialization: a standalone call that stores your game’s window handle so the SDK can anchor its UI (login form, WebView) to it. It takes no callback and returns nothing.

選用,且與初始化分開: 一個獨立的呼叫,用來儲存你的遊戲視窗控制代碼,讓 SDK 可以將其 UI(登入表單、WebView)錨定到該視窗。它不接受回呼,也不傳回任何內容。

可选,且与初始化分开: 一个独立的调用,用来存储你的游戏窗口句柄,让 SDK 可以将其 UI(登录表单、WebView)锚定到该窗口。它不接受回调,也不返回任何内容。

// Optional, standalone: synchronous, no callback:
SetGameWindow(hwnd);

Input

輸入

输入

FieldTypeDescription
gameWindowHWNDHandle of your game window the SDK anchors its UI to.
欄位型別說明
gameWindowHWNDSDK 用來錨定其 UI 的遊戲視窗控制代碼。
字段类型描述
gameWindowHWNDSDK 用来锚定其 UI 的游戏窗口句柄。

Output

輸出

输出

No return value (fire-and-forget).

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

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

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

Presents the login form so the player can pick a sign-in channel.

顯示登入表單,讓玩家選擇登入頻道。

显示登录表单,让玩家选择登录渠道。

ShowLoginForm(callback, /*context*/ nullptr);
// callback receives {"success":true,"data":<user info>} or an 8xx error.

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Show login form error codes (8xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 顯示登入表單錯誤碼(8xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 显示登录表单错误码(8xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

Direct login to a channel

Signs in to one channel directly, bypassing the picker.

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

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

DirectLoginCtx(SDK::Auth::LoginChannel::Google, callback, /*context*/ nullptr);
// callback receives {"success":true,"data":<user info>} or a 2xx error.

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Direct login error codes (2xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 直接登入錯誤碼(2xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 直接登录错误码(2xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

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

LevelUp multiple accounts

Get account

Retrieves the player’s user information from the LevelUp Launcher. After the SDK has initialized and your game is ready to authenticate, call GetAccount to read the signed-in account from the launcher.

從 LevelUp Launcher 取得玩家的使用者資訊。在 SDK 初始化完成、且你的遊戲已準備好進行驗證後,呼叫 GetAccount 以從 Launcher 讀取已登入的帳號。

从 LevelUp Launcher 获取玩家的用户信息。在 SDK 初始化完成、且你的游戏已准备好进行验证后,调用 GetAccount 以从 Launcher 读取已登录的账号。

Recommended: block the game’s UI before you call this, so the player can’t accidentally interact with other game elements during the login process.

建議:在呼叫此方法之前先封鎖遊戲的 UI,讓玩家在登入過程中不會不小心與其他遊戲元素互動。

建议:在调用此方法之前先屏蔽游戏的 UI,让玩家在登录过程中不会不小心与其他游戏元素交互。

GetAccount(callback, /*context*/ nullptr);
// callback data lists the player's signed-in accounts.
// Failures surface as a 9xx MultiAccountErrorCode.

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Multi-account error codes (9xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 多帳號錯誤碼(9xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 多账号错误码(9xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

Select account

Switches the active session to another of the player’s signed-in VNGGames accounts.

將使用中的工作階段切換到玩家另一個已登入的 VNGGames 帳號。

将使用中的会话切换到玩家另一个已登录的 VNGGames 账号。

SelectAccount(callback, /*context*/ nullptr);
// Switches the active session to the chosen account.
// Failures surface as a 9xx MultiAccountErrorCode.

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Multi-account error codes (9xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 多帳號錯誤碼(9xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 多账号错误码(9xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

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

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.

分析的必要設定。

分析的必需设置。

VGSDKAnalytics_MiscConfigAnalytics("role-1", /*roleName*/ "Hero");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
roleNameconst char*Character/role name.
欄位型別說明
roleIdconst char*角色 ID。
roleNameconst char*角色名稱。
字段类型描述
roleIdconst char*角色 id。
roleNameconst char*角色名称。

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

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

// platforms = a bitmask of VGSDKAnalyticsProvider flags:
//   AppsFlyer(1) | DataPlatform(2) | ThinkingData(4)
VGSDKAnalytics_SendCustomEvent("level_up", /*eventParametersJson*/ "{\"level\":5}", /*platforms: AppsFlyer | ThinkingData*/ 1 | 4);

Input

輸入

输入

FieldTypeDescription
eventNameconst char*Event name.
eventParametersJsonconst char*Event parameters.
platformsintBitmask of analytics providers to OR together: AppsFlyer = 1, VNGGames Data Platform = 2, ThinkingData = 4. E.g. AppsFlyer only = 1, AppsFlyer + ThinkingData = 5 (1|4). All three = 7 (1|2|4).
欄位型別說明
eventNameconst char*事件名稱。
eventParametersJsonconst char*事件參數。
platformsint要一起 OR 運算的分析供應商位元遮罩:AppsFlyer = 1、VNGGames Data Platform = 2、ThinkingData = 4。例如:僅 AppsFlyer = 1。AppsFlyer + ThinkingData = 5(1|4)。三者全部 = 7(1|2|4)。
字段类型描述
eventNameconst char*事件名称。
eventParametersJsonconst char*事件参数。
platformsint要一起 OR 运算的分析供应商位掩码:AppsFlyer = 1、VNGGames 数据平台 = 2、ThinkingData = 4。例如:仅 AppsFlyer = 1。AppsFlyer + ThinkingData = 5(1|4)。三者全部 = 7(1|2|4)。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Misc: custom event

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} 形式发送: 请参阅 分析平台前缀

VGSDKAnalytics_MiscCustomEvent("my_event", /*eventParametersJson*/ "{\"k\":\"v\"}");

Input

輸入

输入

FieldTypeDescription
eventNameconst char*Event name.
eventParametersJsonconst char*Event parameters.
欄位型別說明
eventNameconst char*事件名稱。
eventParametersJsonconst char*事件參數。
字段类型描述
eventNameconst char*事件名称。
eventParametersJsonconst char*事件参数。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Conversion Rate

1. App open

Logs an app open.

記錄一次應用程式開啟。

记录一次应用打开。

VGSDKAnalytics_RegAppOpen(/*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

2. Get configuration

Logs the configuration fetch.

記錄設定的取得。

记录配置获取。

VGSDKAnalytics_RegGetConfiguration(/*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

3. Check configuration start

Logs the start of a configuration check.

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

记录配置检查的开始。

VGSDKAnalytics_RegCheckConfigurationStart(/*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

4. Check configuration end

Logs the end of a configuration check.

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

记录配置检查的结束。

VGSDKAnalytics_RegCheckConfigurationEnd(/*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

5. CDN download start

Logs the start of a CDN resource download.

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

记录 CDN 资源下载的开始。

VGSDKAnalytics_RegCDNDownloadStart("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

6. CDN download 25%

Logs 25% CDN download progress.

記錄 CDN 下載 25% 的進度。

记录 CDN 下载进度 25%。

VGSDKAnalytics_RegCDNDownload25("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

6. CDN download 50%

Logs 50% CDN download progress.

記錄 CDN 下載 50% 的進度。

记录 CDN 下载进度 50%。

VGSDKAnalytics_RegCDNDownload50("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

6. CDN download 75%

Logs 75% CDN download progress.

記錄 CDN 下載 75% 的進度。

记录 CDN 下载进度 75%。

VGSDKAnalytics_RegCDNDownload75("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. CDN download finish

Logs CDN download completion.

記錄 CDN 下載完成。

记录 CDN 下载完成。

VGSDKAnalytics_RegCDNDownloadFinish("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

8. Extract resource start

Logs the start of resource extraction.

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

记录资源解压的开始。

VGSDKAnalytics_RegExtractResourceStart("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

9. Extract resource end

Logs the end of resource extraction.

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

记录资源解压的结束。

VGSDKAnalytics_RegExtractResourceEnd("10MB", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Onboarding

1. Joined server

Logs a new user joining a server.

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

记录新用户加入服务器。

VGSDKAnalytics_NruJoinedServer("server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

2. Named role

Logs a role being named.

記錄角色被命名。

记录角色被命名。

VGSDKAnalytics_NruNamedRole("server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

3. Create role success

Logs successful role creation.

記錄角色建立成功。

记录角色创建成功。

VGSDKAnalytics_NruCreateRoleSuccess("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

4. Tutorial start

Logs the tutorial starting.

記錄教學開始。

记录教程开始。

VGSDKAnalytics_NruTutorialStart("role-1", "server-1", "0", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
progressconst char*Progress marker.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
progressconst char*進度標記。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
progressconst char*进度标记。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

5. Tutorial 25%

Logs 25% tutorial progress.

記錄教學 25% 的進度。

记录教程进度 25%。

VGSDKAnalytics_NruTutorialProgress25("role-1", "server-1", "25", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
progressconst char*Progress marker.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
progressconst char*進度標記。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
progressconst char*进度标记。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

5. Tutorial 50%

Logs 50% tutorial progress.

記錄教學 50% 的進度。

记录教程进度 50%。

VGSDKAnalytics_NruTutorialProgress50("role-1", "server-1", "50", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
progressconst char*Progress marker.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
progressconst char*進度標記。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
progressconst char*进度标记。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

5. Tutorial 75%

Logs 75% tutorial progress.

記錄教學 75% 的進度。

记录教程进度 75%。

VGSDKAnalytics_NruTutorialProgress75("role-1", "server-1", "75", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
progressconst char*Progress marker.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
progressconst char*進度標記。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
progressconst char*进度标记。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

6. Tutorial finish

Logs tutorial completion.

記錄教學完成。

记录教程完成。

VGSDKAnalytics_NruTutorialProgressFinish("role-1", "server-1", "100", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
progressconst char*Progress marker.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
progressconst char*進度標記。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
progressconst char*进度标记。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Open shop

Logs the shop being opened.

記錄商店被開啟。

记录商店被打开。

VGSDKAnalytics_IapOpenShop("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Click to buy

Logs the intent to buy an item.

記錄購買道具的意圖。

记录购买物品的意向。

VGSDKAnalytics_IapClickToBuyItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
itemIdconst char*Item id.
itemNameconst char*Item name.
itemPriceconst char*Item price.
itemCurrencyconst char*Currency code.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
itemIdconst char*道具 ID。
itemNameconst char*道具名稱。
itemPriceconst char*道具價格。
itemCurrencyconst char*貨幣代碼。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
itemIdconst char*物品 id。
itemNameconst char*物品名称。
itemPriceconst char*物品价格。
itemCurrencyconst char*货币代码。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Purchased item

Logs a completed purchase.

記錄一次完成的購買。

记录一次完成的购买。

VGSDKAnalytics_IapPurchasedItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
itemIdconst char*Item id.
itemNameconst char*Item name.
itemPriceconst char*Item price.
itemCurrencyconst char*Currency code.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
itemIdconst char*道具 ID。
itemNameconst char*道具名稱。
itemPriceconst char*道具價格。
itemCurrencyconst char*貨幣代碼。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
itemIdconst char*物品 id。
itemNameconst char*物品名称。
itemPriceconst char*物品价格。
itemCurrencyconst char*货币代码。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. VIP level up

Logs a VIP tier increase.

記錄 VIP 等級提升。

记录 VIP 等级提升。

VGSDKAnalytics_IapVipLevelUp("role-1", "server-1", "3", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
currentVipLevelconst char*New VIP level.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
currentVipLevelconst char*新的 VIP 等級。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
currentVipLevelconst char*新的 VIP 等级。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Buy VIP reward level

Logs the purchase of a VIP reward level.

記錄購買 VIP 獎勵等級。

记录购买 VIP 奖励等级。

VGSDKAnalytics_IapBuyVipRewardLevel("role-1", "server-1", "item-1", "VIP Pack", "3", "99000", "VND", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
itemIdconst char*Item id.
itemNameconst char*Item name.
itemVipLevelconst char*VIP level of the item.
itemPriceconst char*Item price.
itemCurrencyconst char*Currency code.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
itemIdconst char*道具 ID。
itemNameconst char*道具名稱。
itemVipLevelconst char*道具的 VIP 等級。
itemPriceconst char*道具價格。
itemCurrencyconst char*貨幣代碼。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
itemIdconst char*物品 id。
itemNameconst char*物品名称。
itemVipLevelconst char*物品的 VIP 等级。
itemPriceconst char*物品价格。
itemCurrencyconst char*货币代码。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Level up

Logs a character level-up.

記錄角色升級。

记录角色升级。

VGSDKAnalytics_MdaLevelUp("role-1", "server-1", "10", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
currentLevelconst char*New level.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
currentLevelconst char*新的等級。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
currentLevelconst char*新的等级。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Agree to terms

Logs acceptance of all terms.

記錄同意所有條款。

记录接受所有条款。

VGSDKAnalytics_NruAgreeAllTerm(/*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Main & Daily Activities

Main quest

Logs main-quest progress.

記錄主線任務的進度。

记录主线任务进度。

VGSDKAnalytics_MdaMainQuest("role-1", "server-1", "q1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
mainQuestIdconst char*Main-quest id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
mainQuestIdconst char*主線任務 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
mainQuestIdconst char*主线任务 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Daily quest

Logs daily-quest progress.

記錄每日任務的進度。

记录每日任务进度。

VGSDKAnalytics_MdaDailyQuest("role-1", "server-1", "d1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
dailyQuestIdconst char*Daily-quest id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
dailyQuestIdconst char*每日任務 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
dailyQuestIdconst char*每日任务 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Grant daily reward

Logs a daily reward grant.

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

记录发放一次每日奖励。

VGSDKAnalytics_MdaGrantDailyReward("role-1", "server-1", "r1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
dailyRewardIdconst char*Daily-reward id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
dailyRewardIdconst char*每日獎勵 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
dailyRewardIdconst char*每日奖励 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Buy item

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

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

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

VGSDKAnalytics_MdaBuyItem("role-1", "server-1", "item-1", "Potion", "100", "gold", "5", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
itemIdconst char*Item id.
itemNameconst char*Item name.
itemPriceconst char*Item price.
itemCurrencyconst char*Currency code.
itemQuantityconst char*Item quantity.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
itemIdconst char*道具 ID。
itemNameconst char*道具名稱。
itemPriceconst char*道具價格。
itemCurrencyconst char*貨幣代碼。
itemQuantityconst char*道具數量。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
itemIdconst char*物品 id。
itemNameconst char*物品名称。
itemPriceconst char*物品价格。
itemCurrencyconst char*货币代码。
itemQuantityconst char*物品数量。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Spend item

Logs spending/consuming an item.

記錄花費/消耗道具。

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

VGSDKAnalytics_MdaSpendItem("role-1", "server-1", "item-1", "Potion", "100", "gold", "5", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
itemIdconst char*Item id.
itemNameconst char*Item name.
itemPriceconst char*Item price.
itemCurrencyconst char*Currency code.
itemQuantityconst char*Item quantity.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
itemIdconst char*道具 ID。
itemNameconst char*道具名稱。
itemPriceconst char*道具價格。
itemCurrencyconst char*貨幣代碼。
itemQuantityconst char*道具數量。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
itemIdconst char*物品 id。
itemNameconst char*物品名称。
itemPriceconst char*物品价格。
itemCurrencyconst char*货币代码。
itemQuantityconst char*物品数量。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Gacha

Logs a gacha pull.

記錄一次轉蛋抽取。

记录一次抽卡。

VGSDKAnalytics_MdaGacha("role-1", "server-1", "banner-a", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
gachaTypeconst char*Gacha type/banner.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
gachaTypeconst char*轉蛋類型/卡池。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
gachaTypeconst char*抽卡类型 / 卡池。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Social & Communities

Create guild

Logs a guild-creation event.

記錄一次公會建立事件。

记录一次公会创建事件。

VGSDKAnalytics_ScCreateGuild("role-1", "server-1", "g1", "Guild", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
guildIdconst char*Guild id.
guildNameconst char*Guild name.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
guildIdconst char*公會 ID。
guildNameconst char*公會名稱。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
guildIdconst char*公会 id。
guildNameconst char*公会名称。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Join guild

Logs a guild-join event.

記錄一次加入公會事件。

记录一次加入公会事件。

VGSDKAnalytics_ScJoinGuild("role-1", "server-1", "g1", "Guild", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
guildIdconst char*Guild id.
guildNameconst char*Guild name.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
guildIdconst char*公會 ID。
guildNameconst char*公會名稱。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
guildIdconst char*公会 id。
guildNameconst char*公会名称。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Quit guild

Logs a guild-quit event.

記錄一次退出公會事件。

记录一次退出公会事件。

VGSDKAnalytics_ScQuitGuild("role-1", "server-1", "g1", "Guild", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
guildIdconst char*Guild id.
guildNameconst char*Guild name.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
guildIdconst char*公會 ID。
guildNameconst char*公會名稱。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
guildIdconst char*公会 id。
guildNameconst char*公会名称。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Add friend

Logs adding a friend on a platform.

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

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

VGSDKAnalytics_ScAddFriendToList("role-1", "server-1", "facebook", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
platformconst char*Social platform name.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
platformconst char*社群平台名稱。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
platformconst char*社交平台名称。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Remove friend

Logs removing a friend on a platform.

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

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

VGSDKAnalytics_ScRemoveFriendFromList("role-1", "server-1", "facebook", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
platformconst char*Social platform name.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
platformconst char*社群平台名稱。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
platformconst char*社交平台名称。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Share to Facebook

Logs a share-to-Facebook event.

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

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

VGSDKAnalytics_ScShareToFacebook("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Invite Facebook friend

Logs a Facebook friend-invite event.

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

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

VGSDKAnalytics_ScInviteFacebookFriend("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Share to Instagram

Logs a share-to-Instagram event.

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

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

VGSDKAnalytics_ScShareToInstagram("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Other

Splash screen

Logs the splash screen being shown.

記錄啟動畫面被顯示。

记录启动画面的展示。

VGSDKAnalytics_RegSplashScreen(/*extraDataJson*/ "{}");

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Purchase canceled

Logs a canceled purchase.

記錄一次已取消的購買。

记录一次已取消的购买。

VGSDKAnalytics_IapPurchasedCanceledItem("role-1", "server-1", "item-1", "Gold", "22000", "VND", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
itemIdconst char*Item id.
itemNameconst char*Item name.
itemPriceconst char*Item price.
itemCurrencyconst char*Currency code.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
itemIdconst char*道具 ID。
itemNameconst char*道具名稱。
itemPriceconst char*道具價格。
itemCurrencyconst char*貨幣代碼。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
itemIdconst char*物品 id。
itemNameconst char*物品名称。
itemPriceconst char*物品价格。
itemCurrencyconst char*货币代码。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Switch account

Logs an account switch.

記錄一次帳號切換。

记录一次账号切换。

VGSDKAnalytics_MiscSwitchAccount("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Customer support

Logs a customer-support entry.

記錄一次進入客戶支援。

记录一次进入客户支持。

VGSDKAnalytics_MiscCustomerSupport("role-1", "server-1", /*extraDataJson*/ "{}");

Input

輸入

输入

FieldTypeDescription
roleIdconst char*Character/role id.
serverIdconst char*Game server id.
extraDataJsonconst char*Additional custom key/values attached to the event.
欄位型別說明
roleIdconst char*角色 ID。
serverIdconst char*遊戲伺服器 ID。
extraDataJsonconst char*附加到事件的額外自訂鍵/值。
字段类型描述
roleIdconst char*角色 id。
serverIdconst char*游戏服务器 id。
extraDataJsonconst char*附加到该事件的额外自定义键值对。

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

Presents the support center for the player.

為玩家顯示支援中心。

为玩家展示客户支持中心。

ShowCustomerSupportCtx(userId, SDK::Auth::LoginChannel::Google, serverId,
                       roleName, level, guild, content,
                       callback, /*context*/ nullptr);
// Failures surface as a 7xx ShowCustomerSupportErrorCode.

Input

輸入

输入

FieldTypeDescription
userIdconst char*Signed-in user id.
loginChannelSDK::Auth::LoginChannelLogin channel: see LoginChannel.
serverIdconst char*Game server id.
roleNameconst char*Player role name.
levelconst char*Player level.
guildconst char*Player guild.
contentconst char*Prefilled ticket content.
欄位型別說明
userIdconst char*已登入的使用者 id。
loginChannelSDK::Auth::LoginChannel登入頻道: 請參閱 LoginChannel
serverIdconst char*遊戲伺服器 ID。
roleNameconst char*玩家角色名稱。
levelconst char*玩家等級。
guildconst char*玩家公會。
contentconst char*預先填入的工單內容。
字段类型描述
userIdconst char*已登录的用户 id。
loginChannelSDK::Auth::LoginChannel登录渠道: 请参阅 LoginChannel
serverIdconst char*游戏服务器 id。
roleNameconst char*玩家角色名称。
levelconst char*玩家等级。
guildconst char*玩家公会。
contentconst char*预先填入的工单内容。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Customer support error codes (7xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 客戶支援錯誤碼(7xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 客户支持错误码(7xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

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 应用内消息均由服务端下发,不暴露客户端调用。

In-App WebView

Show in-app WebView

Opens a URL in an in-app WebView.

在應用程式內 WebView 中開啟一個 URL。

在应用内 WebView 中打开一个 URL。

VGSDKEngage_OpenWebView("https://example.com", callback, /*context*/ nullptr);
// Failures surface as a 10xx VGSDKEngage_OpenWebView_ErrorCode.

Input

輸入

输入

FieldTypeDescription
urlconst char*URL to open in the in-app WebView.
欄位型別說明
urlconst char*要載入的 URL。
字段类型描述
urlconst char*要加载的 URL。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See In-app WebView error codes (10xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 應用程式內 WebView 錯誤碼(10xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 应用内 WebView 错误码(10xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

User Experience

Native store rating prompt and in-chat Google Translate.

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

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

Translate text

Translates text into a target language via Google Translate. The result is delivered asynchronously.

透過 Google Translate 將文字翻譯為目標語言。結果會以非同步方式傳回。

通过 Google Translate 将文本翻译为目标语言。结果异步返回。

TranslateCtx("Xin chào", "vi", "en", callback, /*context*/ nullptr);
// callback data carries the translated text; failures are a 4xx TranslateErrorCode.

Input

輸入

输入

FieldTypeDescription
textconst char*Source text to translate.
fromconst char*Source language code.
toconst char*Target language code.
欄位型別說明
textconst char*要翻譯的文字。
fromconst char*來源語言代碼。
toconst char*目標語言代碼。
字段类型描述
textconst char*要翻译的文本。
fromconst char*源语言代码。
toconst char*目标语言代码。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Translate error codes (4xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 翻譯錯誤碼(4xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 翻译错误码(4xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

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 SDK version

Returns the VNGGames SDK version.

傳回 VNGGames SDK 版本。

返回 VNGGames SDK 版本。

GetSdkVersionCtx(callback, /*context*/ nullptr);
// callback data carries the SDK version string.

Input

輸入

输入

FieldTypeDescription
callbackResultCallbackCtxYour result callback: a ResultCallbackCtx, i.e. void(__stdcall*)(void* context, const char* resultJson). The SDK invokes it asynchronously with the result (see Output).
contextvoid*Opaque pointer echoed back to your callback’s context parameter. Pass nullptr if you don’t need it.
欄位型別說明
callbackResultCallbackCtx你的結果回呼: 一個 ResultCallbackCtx,即 void(__stdcall*)(void* context, const char* resultJson)。SDK 會以非同步方式呼叫它並帶入結果(見 Output)。
contextvoid*會原封不動回傳到你回呼 context 參數的不透明指標。若不需要請傳入 nullptr
字段类型描述
callbackResultCallbackCtx你的结果回调: 一个 ResultCallbackCtx,即 void(__stdcall*)(void* context, const char* resultJson)。SDK 会以异步方式调用它并传入结果(见 Output)。
contextvoid*会原样回传到你回调 context 参数的不透明指针。若不需要请传入 nullptr

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Error Codes.
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 錯誤碼
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 错误码
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

Get current country code

Returns the player’s country code when it is one of the game’s publish-market countries, otherwise returns OT (other).

當玩家的國家/地區屬於遊戲發行市場的國家之一時傳回其代碼。否則傳回 OT(其他)。

当玩家的国家 / 地区代码属于游戏发行市场之一时返回该代码。否则返回 OT(其他)。

GetCachedCountryCodeCtx(callback, /*context*/ nullptr);
// callback data carries the cached ISO country code.

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
resultJsonconst char*The JSON result string passed to your callback (its 2nd argument). Parse it into the fields below.
successbooltrue on success, false on failure.
dataobject?Result payload on success (null when the call returns no data).
errorCodeint32_tOn failure only: a value from this call’s error enum. See Get country code error codes (5xx).
errorMessageconst char*On failure only: a human-readable message.
欄位型別說明
resultJsonconst char*傳入你回呼的 JSON 結果字串(第 2 個參數)。請將它解析為下列欄位。
successbool成功時為 true,失敗時為 false
dataobject?成功時的結果內容(當呼叫不傳回資料時為 null)。
errorCodeint32_t僅在失敗時存在: 來自此呼叫錯誤列舉的值。請參閱 取得國家代碼錯誤碼(5xx)
errorMessageconst char*僅在失敗時存在: 一段人類可讀的訊息。
字段类型描述
resultJsonconst char*传入你回调的 JSON 结果字符串(第 2 个参数)。请将它解析为下列字段。
successbool成功时为 true,失败时为 false
dataobject?成功时的结果负载(当调用不返回数据时为 null)。
errorCodeint32_t仅在失败时存在: 来自此调用错误枚举的值。请参阅 获取国家代码错误码(5xx)
errorMessageconst char*仅在失败时存在: 一段人类可读的消息。

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 = 其原始值。

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
Zing1Zing ID.
Email2Email.
Apple4Sign in with Apple.
Facebook5Facebook.
Google6Google.
PlayNow7PlayNow.
欄位型別說明
Zing1Zing ID。
Email2電子郵件。
Apple4使用 Apple 登入。
Facebook5Facebook。
Google6Google。
PlayNow7PlayNow。
字段类型描述
Zing1Zing ID。
Email2电子邮箱。
Apple4Sign in with Apple。
Facebook5Facebook。
Google6Google。
PlayNow7PlayNow。

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 seconds.
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.
response_infoStringAdded only on events that report an outcome. JSON-encoded: status (Success / Failed / Canceled), error_code, remote (0 local, 1 remote).
欄位型別說明
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。
response_infoString僅在回報結果的事件上加入。JSON 編碼:statusSuccessFailedCanceled)、error_coderemote0 本機、1 遠端)。
字段类型描述
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。
response_infoString仅在报告结果的事件上添加。JSON 编码:statusSuccess / Failed / Canceled)、error_coderemote0 本地,1 远程)。

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
AppsFlyerafAppsFlyer.
DataPlatformdpVNGGames Data Platform.
ThinkingDatatdThinkingData.
欄位型別說明
AppsFlyerafAppsFlyer。
DataPlatformdpVNGGames Data Platform。
ThinkingDatatdThinkingData。
字段类型描述
AppsFlyerafAppsFlyer。
DataPlatformdpVNGGames 数据平台。
ThinkingDatatdThinkingData。

Error Codes

On Windows, every SDK call reports its outcome through the result callback as a JSON string. On success it is {"success":true,"data":<payload|null>}. On failure it is {"success":false,"errorCode":<int>,"errorMessage":"<text>"}. The tables below list the public errorCode values, banded by the API entry point that raises them (century blocks). These are Windows-specific and share no numbers with the iOS/Android scheme.

在 Windows 上,每個 SDK 呼叫都會透過結果回呼以 JSON 字串回報其結果。成功時為 {"success":true,"data":<payload|null>}。失敗時為 {"success":false,"errorCode":<int>,"errorMessage":"<text>"}。下方表格列出公開的 errorCode 值,並依引發它們的 API 進入點分段(百位區塊)。這些為 Windows 專屬,與 iOS/Android 方案不共用任何編號。

在 Windows 上,每个 SDK 调用都会通过结果回调以 JSON 字符串回报其结果。成功时为 {"success":true,"data":<payload|null>}。失败时为 {"success":false,"errorCode":<int>,"errorMessage":"<text>"}。下方表格列出公开的 errorCode 值,并按引发它们的 API 入口点分段(百位区块)。这些为 Windows 专属,与 iOS/Android 方案不共用任何编号。

Windows: Initialize SDK (1xx)

Errors from InitializeSdk: config loading, IPC, and URI-scheme registration (InitializeSdkErrorCode).

來自 InitializeSdk 的錯誤: 設定載入、IPC 與 URI scheme 註冊(InitializeSdkErrorCode)。

来自 InitializeSdk 的错误: 配置加载、IPC 与 URI scheme 注册(InitializeSdkErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
100UnexpectedErrorUnexpected internal error.
102ConfigParseErrorSDK config could not be parsed.
104IPCErrorInter-process communication failure.
105RegisterURISchemeErrorFailed to register the URI scheme.
112AlreadyInitializingInitialization is already in progress.
113AlreadyInitializedSDK is already initialized.
114ConfigNotFoundSDK config file was not found.
115ConfigAccessDeniedAccess to the SDK config was denied.
116ConfigUnknownErrorUnknown error reading the SDK config.
欄位型別說明
100UnexpectedError未預期的內部錯誤。
102ConfigParseError無法解析 SDK 設定。
104IPCError行程間通訊失敗。
105RegisterURISchemeError註冊 URI scheme 失敗。
112AlreadyInitializing初始化已在進行中。
113AlreadyInitializedSDK 已初始化。
114ConfigNotFound找不到 SDK 設定檔。
115ConfigAccessDenied存取 SDK 設定遭拒。
116ConfigUnknownError讀取 SDK 設定時發生未知錯誤。
字段类型描述
100UnexpectedError意外的内部错误。
102ConfigParseError无法解析 SDK 配置。
104IPCError进程间通信失败。
105RegisterURISchemeError注册 URI scheme 失败。
112AlreadyInitializing初始化已在进行中。
113AlreadyInitializedSDK 已初始化。
114ConfigNotFound找不到 SDK 配置文件。
115ConfigAccessDenied访问 SDK 配置被拒绝。
116ConfigUnknownError读取 SDK 配置时发生未知错误。

Windows: Direct login (2xx)

Errors from DirectLogin / DirectLoginCtx (DirectLoginErrorCode).

來自 DirectLogin / DirectLoginCtx 的錯誤(DirectLoginErrorCode)。

来自 DirectLogin / DirectLoginCtx 的错误(DirectLoginErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
200UnexpectedErrorUnexpected internal error.
201AuthorizationErrorAuthorization failed.
202RequestAccessTokenErrorFailed to obtain an access token.
203GetUserInfoErrorFailed to fetch the user profile.
204UnsupportedLoginChannelLogin channel is not supported.
205DetectCountryErrorFailed to detect the player’s country.
207LegacyLoginErrorLegacy (Passport) login failed.
208BootstrapErrorSDK bootstrap failed.
209CanceledPlayer canceled login.
欄位型別說明
200UnexpectedError未預期的內部錯誤。
201AuthorizationError授權失敗。
202RequestAccessTokenError取得存取權杖失敗。
203GetUserInfoError取得使用者個人資料失敗。
204UnsupportedLoginChannel不支援此登入頻道。
205DetectCountryError偵測玩家所在國家/地區失敗。
207LegacyLoginError舊版(Passport)登入失敗。
208BootstrapErrorSDK 啟動程序失敗。
209Canceled玩家取消登入。
字段类型描述
200UnexpectedError意外的内部错误。
201AuthorizationError授权失败。
202RequestAccessTokenError获取访问令牌失败。
203GetUserInfoError获取用户资料失败。
204UnsupportedLoginChannel不支持此登录渠道。
205DetectCountryError检测玩家所在国家/地区失败。
207LegacyLoginError旧版(Passport)登录失败。
208BootstrapErrorSDK 引导启动失败。
209Canceled玩家取消了登录。

Windows: AppsFlyer log event (3xx)

Errors from AppsflyerLogEvent (AppsflyerLogEventErrorCode).

來自 AppsflyerLogEvent 的錯誤(AppsflyerLogEventErrorCode)。

来自 AppsflyerLogEvent 的错误(AppsflyerLogEventErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
300UnexpectedErrorUnexpected internal error.
301EventParamsInvalidJsonEvent parameters were not valid JSON.
欄位型別說明
300UnexpectedError未預期的內部錯誤。
301EventParamsInvalidJson事件參數不是有效的 JSON。
字段类型描述
300UnexpectedError意外的内部错误。
301EventParamsInvalidJson事件参数不是有效的 JSON。

Windows: Translate (4xx)

Errors from Translate / TranslateCtx (TranslateErrorCode).

來自 Translate / TranslateCtx 的錯誤(TranslateErrorCode)。

来自 Translate / TranslateCtx 的错误(TranslateErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
400UnexpectedErrorUnexpected internal error.
401HttpRequestFailedThe translate HTTP request failed.
欄位型別說明
400UnexpectedError未預期的內部錯誤。
401HttpRequestFailed翻譯 HTTP 請求失敗。
字段类型描述
400UnexpectedError意外的内部错误。
401HttpRequestFailed翻译 HTTP 请求失败。

Windows: Get cached country code (5xx)

Errors from GetCachedCountryCode (GetCachedCountryCodeErrorCode).

來自 GetCachedCountryCode 的錯誤(GetCachedCountryCodeErrorCode)。

来自 GetCachedCountryCode 的错误(GetCachedCountryCodeErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
500UnexpectedErrorUnexpected internal error.
欄位型別說明
500UnexpectedError未預期的內部錯誤。
字段类型描述
500UnexpectedError意外的内部错误。

Windows: Customer support (7xx)

Errors from ShowCustomerSupport (ShowCustomerSupportErrorCode).

來自 ShowCustomerSupport 的錯誤(ShowCustomerSupportErrorCode)。

来自 ShowCustomerSupport 的错误(ShowCustomerSupportErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
700UnexpectedErrorUnexpected internal error.
欄位型別說明
700UnexpectedError未預期的內部錯誤。
字段类型描述
700UnexpectedError意外的内部错误。

Windows: Show login form (8xx)

Errors from ShowLoginForm: the same failure set as direct login, at a different entry point (ShowLoginFormErrorCode).

來自 ShowLoginForm 的錯誤: 與直接登入相同的失敗集合,只是進入點不同(ShowLoginFormErrorCode)。

来自 ShowLoginForm 的错误: 与直接登录相同的失败集合,只是入口点不同(ShowLoginFormErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
800UnexpectedErrorUnexpected internal error.
801AuthorizationErrorAuthorization failed.
802RequestAccessTokenErrorFailed to obtain an access token.
803GetUserInfoErrorFailed to fetch the user profile.
804UnsupportedLoginChannelLogin channel is not supported.
805DetectCountryErrorFailed to detect the player’s country.
807LegacyLoginErrorLegacy (Passport) login failed.
808BootstrapErrorSDK bootstrap failed.
809CanceledPlayer canceled login.
欄位型別說明
800UnexpectedError未預期的內部錯誤。
801AuthorizationError授權失敗。
802RequestAccessTokenError取得存取權杖失敗。
803GetUserInfoError取得使用者個人資料失敗。
804UnsupportedLoginChannel不支援此登入頻道。
805DetectCountryError偵測玩家所在國家/地區失敗。
807LegacyLoginError舊版(Passport)登入失敗。
808BootstrapErrorSDK 啟動程序失敗。
809Canceled玩家取消登入。
字段类型描述
800UnexpectedError意外的内部错误。
801AuthorizationError授权失败。
802RequestAccessTokenError获取访问令牌失败。
803GetUserInfoError获取用户资料失败。
804UnsupportedLoginChannel不支持此登录渠道。
805DetectCountryError检测玩家所在国家/地区失败。
807LegacyLoginError旧版(Passport)登录失败。
808BootstrapErrorSDK 引导启动失败。
809Canceled玩家取消了登录。

Windows: Multi-account / LevelUp (9xx)

Errors from GetAccount / SelectAccount (MultiAccountErrorCode).

來自 GetAccount / SelectAccount 的錯誤(MultiAccountErrorCode)。

来自 GetAccount / SelectAccount 的错误(MultiAccountErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
900UnexpectedErrorUnexpected internal error.
901InvalidNexusContextInvalid multi-account (Nexus) context.
902DetectCountryErrorFailed to detect the player’s country.
903BootstrapErrorSDK bootstrap failed.
904PrimarySessionErrorPrimary account session error.
欄位型別說明
900UnexpectedError未預期的內部錯誤。
901InvalidNexusContext無效的多帳號(Nexus)內容。
902DetectCountryError偵測玩家所在國家/地區失敗。
903BootstrapErrorSDK 啟動程序失敗。
904PrimarySessionError主要帳號工作階段錯誤。
字段类型描述
900UnexpectedError意外的内部错误。
901InvalidNexusContext无效的多账号(Nexus)上下文。
902DetectCountryError检测玩家所在国家/地区失败。
903BootstrapErrorSDK 引导启动失败。
904PrimarySessionError主账号会话错误。

Windows: In-app WebView (10xx)

Errors from VGSDKEngage_OpenWebView (VGSDKEngage_OpenWebView_ErrorCode).

來自 VGSDKEngage_OpenWebView 的錯誤(VGSDKEngage_OpenWebView_ErrorCode)。

来自 VGSDKEngage_OpenWebView 的错误(VGSDKEngage_OpenWebView_ErrorCode)。

Codes

錯誤碼

错误码

FieldTypeDescription
1000UnexpectedErrorUnexpected internal error.
1001UnsupportedWebView is not supported.
1002InvalidUrlThe provided URL is invalid.
欄位型別說明
1000UnexpectedError未預期的內部錯誤。
1001Unsupported不支援 WebView。
1002InvalidUrl提供的 URL 無效。
字段类型描述
1000UnexpectedError意外的内部错误。
1001Unsupported不支持 WebView。
1002InvalidUrl提供的 URL 无效。