Unreal 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

The VNGGames SDK ships as an Unreal plugin that compiles from source: there is no binary drop-in. You add it to a C++ project, enable it, and let the engine’s per-platform build steps stage the native SDKs for you.

VNGGames SDK 以 Unreal 外掛原始碼形式發佈,沒有預先編譯的版本可直接放入專案。請將它加入 C++ 專案並啟用,引擎的各平台建置步驟就會自動為你部署原生 SDK。

VNGGames SDK 以 Unreal 插件源码形式发布,没有预编译版本可直接放入项目。请将它加入 C++ 项目并启用,引擎的各平台构建步骤就会自动为你部署原生 SDK。

The plugin exports no API macro, so its C++ entry points do not link from a separate game module in a modular build. Drive the SDK from Blueprint, which is what the shipped demo does. The C++ tab on each method documents the real signatures for reading the API and for plugin-internal or monolithic builds.

此外掛未匯出 API 巨集,因此在模組化建置中,其 C++ 進入點無法從獨立的遊戲模組連結。請改用 Blueprint 呼叫 SDK,隨附的示範專案也是這樣做。各方法的 C++ 分頁用於閱讀真實簽章,以及外掛內部或單體式建置的情境。

此插件未导出 API 宏,因此在模块化构建中,其 C++ 入口点无法从独立的游戏模块链接。请改用 Blueprint 调用 SDK,随附的演示项目也是这样做的。各方法的 C++ 选项卡用于阅读真实签名,以及插件内部或单体式构建的场景。

Prerequisites

  • Unreal Engine 5.5 or newer. The plugin declares no engine floor of its own, and the shipped docs are inconsistent: the Windows integration doc states 5.5+ validated on 5.7, while the demo project is associated with 5.7. Treat 5.5 as the minimum and 5.7 as the validated version.
  • A C++ project. The plugin builds from source, so a Blueprint-only project must be converted first.
  • The VNGGames SDK plugin package for your title, obtained from VNGGames.
  • Per-title configuration assets, also from VNGGames: the Android service JSON files and signing keystore, the iOS property lists, and the Windows vnggamessdk.dat.
  • Windows builds: Visual Studio 2022 with the Windows 10 or 11 SDK.
  • iOS builds: macOS with Xcode.
  • Android builds: network access from the build machine to the VNGGames Maven repository, which the plugin’s Gradle injection resolves its native dependency from.
  • Unreal Engine 5.5 以上。 外掛本身未宣告引擎版本下限,且隨附文件說法不一致:Windows 整合文件寫 5.5 以上、在 5.7 驗證,而示範專案關聯的是 5.7。請以 5.5 為最低版本、5.7 為已驗證版本。
  • C++ 專案。 外掛需要從原始碼建置,純 Blueprint 專案必須先轉換。
  • 由 VNGGames 提供、對應你遊戲的 VNGGames SDK 外掛套件
  • 同樣由 VNGGames 提供的各遊戲設定檔:Android 的服務 JSON 檔與簽章 keystore、iOS 的 property list,以及 Windows 的 vnggamessdk.dat
  • Windows 建置:Visual Studio 2022 搭配 Windows 10 或 11 SDK。
  • iOS 建置:macOS 搭配 Xcode。
  • Android 建置:建置機器需能連線至 VNGGames Maven 儲存庫,外掛的 Gradle 注入會由此解析原生相依套件。
  • Unreal Engine 5.5 以上。 插件本身未声明引擎版本下限,且随附文档说法不一致:Windows 集成文档写 5.5 以上、在 5.7 验证,而演示项目关联的是 5.7。请以 5.5 为最低版本、5.7 为已验证版本。
  • C++ 项目。 插件需要从源码构建,纯 Blueprint 项目必须先转换。
  • 由 VNGGames 提供、对应你游戏的 VNGGames SDK 插件包
  • 同样由 VNGGames 提供的各游戏配置文件:Android 的服务 JSON 文件与签名 keystore、iOS 的 property list,以及 Windows 的 vnggamessdk.dat
  • Windows 构建:Visual Studio 2022 搭配 Windows 10 或 11 SDK。
  • iOS 构建:macOS 搭配 Xcode。
  • Android 构建:构建机器需能连接 VNGGames Maven 仓库,插件的 Gradle 注入会由此解析原生依赖包。

Dependencies

Every third-party library the plugin brings into your build, one tab per build target. The iOS frameworks ship inside the plugin and are embedded by VNGGamesSDK.Build.cs. The Android target resolves its libraries through the vgsdk-service Gradle plugin from your pass-services.json, and the Windows target links one self-contained DLL.

外掛帶進你建置中的所有第三方函式庫,每個建置目標一個分頁。iOS framework 隨外掛一併發佈,並由 VNGGamesSDK.Build.cs 嵌入。Android 目標會透過 vgsdk-service Gradle 外掛依你的 pass-services.json 解析其函式庫,而 Windows 目標則連結單一自足的 DLL。

插件带进你构建中的所有第三方库,每个构建目标一个标签页。iOS framework 随插件一并发布,并由 VNGGamesSDK.Build.cs 嵌入。Android 目标会通过 vgsdk-service Gradle 插件依你的 pass-services.json 解析其库,而 Windows 目标则链接单一自足的 DLL。

LibraryVersionGroup
Reachability3.7.6Core
KeychainAccess4.2.2Core
SwiftCentrifuge0.8.2Core
FirebaseCore11.15.0Core
FirebaseInstallations11.15.0Core
IASDKCore8.3.1Core
FirebaseCoreInternal11.15.0Core
FirebaseSharedSwift11.15.0Core
GoogleUtilities8.1.0Core
GoogleDataTransport10.1.0Core
nanopb3.30910.0Core
FBLPromises2.4.0Core
AppCheckCore11.2.0Core
SwiftProtobuf1.31.1Core
FBSDKCoreKit18.0.1Login channels
FBSDKCoreKit_Basics18.0.1Login channels
FBAEMKit18.0.1Login channels
FBSDKLoginKit18.0.1Login channels
GoogleSignIn8.0.0Login channels
AppAuth1.7.6Login channels
GTMAppAuth4.1.1Login channels
GTMSessionFetcher3.5.0Login channels
ThinkingSDK3.3.2Analytics
ThinkingDataCore1.3.2Analytics
FBSDKShareKit18.0.1Social
FBSDKGamingServicesKit18.0.1Social
CleverTapSDK7.4.1Engage
CTNotificationService0.1.7Engage
CTNotificationContent1.1.0Engage
FirebaseMessaging11.15.0Engage
FirebaseRemoteConfig11.15.0Engage
FirebaseInAppMessaging11.15.0Engage
FirebaseABTesting11.15.0Engage
FirebaseRemoteConfigInterop11.15.0Engage
SDWebImage5.21.2Engage
SocketRocket0.7.1Engage
函式庫版本分組
Reachability3.7.6核心
KeychainAccess4.2.2核心
SwiftCentrifuge0.8.2核心
FirebaseCore11.15.0核心
FirebaseInstallations11.15.0核心
IASDKCore8.3.1核心
FirebaseCoreInternal11.15.0核心
FirebaseSharedSwift11.15.0核心
GoogleUtilities8.1.0核心
GoogleDataTransport10.1.0核心
nanopb3.30910.0核心
FBLPromises2.4.0核心
AppCheckCore11.2.0核心
SwiftProtobuf1.31.1核心
FBSDKCoreKit18.0.1登入管道
FBSDKCoreKit_Basics18.0.1登入管道
FBAEMKit18.0.1登入管道
FBSDKLoginKit18.0.1登入管道
GoogleSignIn8.0.0登入管道
AppAuth1.7.6登入管道
GTMAppAuth4.1.1登入管道
GTMSessionFetcher3.5.0登入管道
ThinkingSDK3.3.2分析
ThinkingDataCore1.3.2分析
FBSDKShareKit18.0.1社群
FBSDKGamingServicesKit18.0.1社群
CleverTapSDK7.4.1Engage
CTNotificationService0.1.7Engage
CTNotificationContent1.1.0Engage
FirebaseMessaging11.15.0Engage
FirebaseRemoteConfig11.15.0Engage
FirebaseInAppMessaging11.15.0Engage
FirebaseABTesting11.15.0Engage
FirebaseRemoteConfigInterop11.15.0Engage
SDWebImage5.21.2Engage
SocketRocket0.7.1Engage
版本分组
Reachability3.7.6核心
KeychainAccess4.2.2核心
SwiftCentrifuge0.8.2核心
FirebaseCore11.15.0核心
FirebaseInstallations11.15.0核心
IASDKCore8.3.1核心
FirebaseCoreInternal11.15.0核心
FirebaseSharedSwift11.15.0核心
GoogleUtilities8.1.0核心
GoogleDataTransport10.1.0核心
nanopb3.30910.0核心
FBLPromises2.4.0核心
AppCheckCore11.2.0核心
SwiftProtobuf1.31.1核心
FBSDKCoreKit18.0.1登录渠道
FBSDKCoreKit_Basics18.0.1登录渠道
FBAEMKit18.0.1登录渠道
FBSDKLoginKit18.0.1登录渠道
GoogleSignIn8.0.0登录渠道
AppAuth1.7.6登录渠道
GTMAppAuth4.1.1登录渠道
GTMSessionFetcher3.5.0登录渠道
ThinkingSDK3.3.2分析
ThinkingDataCore1.3.2分析
FBSDKShareKit18.0.1社交
FBSDKGamingServicesKit18.0.1社交
CleverTapSDK7.4.1Engage
CTNotificationService0.1.7Engage
CTNotificationContent1.1.0Engage
FirebaseMessaging11.15.0Engage
FirebaseRemoteConfig11.15.0Engage
FirebaseInAppMessaging11.15.0Engage
FirebaseABTesting11.15.0Engage
FirebaseRemoteConfigInterop11.15.0Engage
SDWebImage5.21.2Engage
SocketRocket0.7.1Engage

Installation

Add the plugin to your project

Copy the VNGGamesSDK folder into your project’s Plugins directory, so it sits at <YourProject>/Plugins/VNGGamesSDK/. The package ships Source/, Docs/ and the .uplugin descriptor. It deliberately contains no Binaries/ or Intermediate/, which is why the first build compiles the plugin.

VNGGamesSDK 資料夾複製到專案的 Plugins 目錄下,路徑為 <YourProject>/Plugins/VNGGamesSDK/。套件內含 Source/Docs/.uplugin 描述檔,並刻意不包含 Binaries/Intermediate/,因此第一次建置會編譯外掛。

VNGGamesSDK 文件夹复制到项目的 Plugins 目录下,路径为 <YourProject>/Plugins/VNGGamesSDK/。安装包内含 Source/Docs/.uplugin 描述文件,并刻意不包含 Binaries/Intermediate/,因此第一次构建会编译插件。

Enable it in your .uproject

Add the plugin to the Plugins array of your .uproject, listing the target platforms you ship.

.uprojectPlugins 陣列中加入此外掛,並列出你要發佈的目標平台。

.uprojectPlugins 数组中加入此插件,并列出你要发布的目标平台。

"Plugins": [
  {
    "Name": "VNGGamesSDK",
    "Enabled": true,
    "SupportedTargetPlatforms": [ "Android", "IOS", "Win64" ]
  }
]

Reference the module from your game

Add VNGGamesSDK to your game module’s dependencies in its Build.cs.

在遊戲模組的 Build.cs 中,將 VNGGamesSDK 加入相依模組。

在游戏模块的 Build.cs 中,将 VNGGamesSDK 加入依赖模块。

PrivateDependencyModuleNames.AddRange(new string[] { "VNGGamesSDK" });

Set the build environment

On an installed (Launcher) engine, set both of these in your Target.cs and TargetEditor.cs. Without them Unreal Build Tool fails with Targets with unique build environment cannot be built with installed engine. A source-built engine may keep its own unique environment.

使用安裝版(Launcher)引擎時,請在 Target.csTargetEditor.cs 中同時設定以下兩項。若未設定,Unreal Build Tool 會出現 Targets with unique build environment cannot be built with installed engine 錯誤。自行編譯的引擎則可維持其獨立環境。

使用安装版(Launcher)引擎时,请在 Target.csTargetEditor.cs 中同时设置以下两项。若未设置,Unreal Build Tool 会出现 Targets with unique build environment cannot be built with installed engine 错误。自行编译的引擎则可保持其独立环境。

BuildEnvironment = TargetBuildEnvironment.Shared;
DefaultBuildSettings = BuildSettingsVersion.V6;

Regenerate and build

Regenerate your project files and build. The SDK initializes itself as soon as its module loads, so there is nothing to call at startup. Gate your first feature call on the Wait for initialization signal instead, because on the Windows target initialization is asynchronous.

重新產生專案檔並建置。SDK 會在模組載入時自行初始化,因此啟動時不需要呼叫任何項目。請改以 等待初始化完成 訊號作為第一個功能呼叫的前置條件,因為在 Windows 目標上初始化是非同步的。

重新生成项目文件并构建。SDK 会在模块加载时自行初始化,因此启动时不需要调用任何内容。请改以 等待初始化完成 信号作为第一个功能调用的前置条件,因为在 Windows 目标上初始化是异步的。

Platform configuration

iOS

The build script globs every .framework under Source/ThirdParty/iOS/Frameworks and every file under Source/ThirdParty/iOS/Resources, so the link set follows the folder rather than a hard-coded list. The property lists in Resources are part of your title’s export, so there is nothing to swap in by hand.

One item is NOT per-title and ships wrong in every package:

  1. Replace the NSUserTrackingUsageDescription text. The plugin injects it into Info.plist as the literal placeholder Put description here, and App Store review rejects builds that keep it.
  2. Keep the -ObjC shipping linker flag set, which the SDK’s static frameworks require.

One trap worth knowing: the build script RETURNS EARLY if Frameworks or Resources is missing, silently skipping the rest of the iOS setup including the system frameworks. A missing folder gives you a half-configured link rather than an error.

建置指令碼會掃描 Source/ThirdParty/iOS/Frameworks 下所有 .frameworkSource/ThirdParty/iOS/Resources 下所有檔案,因此連結清單取決於資料夾內容而非寫死的列表。Resources 中的 property list 屬於你遊戲匯出內容的一部分,因此不需要手動替換。

有一項設定並非各遊戲專屬,且在每個套件中都是錯的:

  1. 替換 NSUserTrackingUsageDescription 文字。 外掛會將它以字面上的預留字串 Put description here 注入 Info.plist,若未修改,App Store 審核會退件。
  2. 保留 -ObjC 發佈連結器旗標,SDK 的靜態 framework 需要它。

另有一個值得注意的陷阱:若 FrameworksResources 資料夾不存在,建置指令碼會提前返回,靜默略過其餘的 iOS 設定(包含系統 framework)。缺少資料夾時得到的是設定不完整的連結結果,而不是明確錯誤。

构建脚本会扫描 Source/ThirdParty/iOS/Frameworks 下所有 .frameworkSource/ThirdParty/iOS/Resources 下所有文件,因此链接列表取决于文件夹内容而非写死的列表。Resources 中的 property list 属于你游戏导出内容的一部分,因此不需要手动替换。

有一项配置并非各游戏专属,且在每个包中都是错的:

  1. 替换 NSUserTrackingUsageDescription 文本。 插件会将它以字面上的占位字符串 Put description here 注入 Info.plist,若未修改,App Store 审核会拒绝。
  2. 保留 -ObjC 发布链接器标志,SDK 的静态 framework 需要它。

另有一个值得注意的陷阱:若 FrameworksResources 文件夹不存在,构建脚本会提前返回,静默跳过其余的 iOS 配置(包含系统 framework)。缺少文件夹时得到的是配置不完整的链接结果,而不是明确错误。

Windows

The build script stages VNGGamesSDK.dll and vnggamessdk.dat next to your game executable, and the DLL is delay-loaded and resolved at runtime, so there is no import library to link.

The .dat is your title’s encrypted config and ships inside the export, so there is nothing to swap in by hand. What you do need to do:

  1. Declare the init config in your project’s DefaultGame.ini. This is the one genuinely manual step on Windows, and the plugin ships it EMPTY. PackageName is the only source for the package name here, because the engine has no equivalent setting, and initialization logs an error and falls back to the project name when it is blank.
  2. Check the staged launcher matches your title. Deep-link registration keys off the launcher’s exact filename, and packages have shipped carrying a launcher named for a different game. If the .exe beside the DLL is not yours, deep links will not resolve.

建置指令碼會將 VNGGamesSDK.dllvnggamessdk.dat 部署到遊戲執行檔旁邊。該 DLL 採延遲載入並於執行期解析,因此不需要連結匯入函式庫。

.dat 是你遊戲的加密設定檔,已包含在匯出內容中,因此不需要手動替換。你需要做的是:

  1. 在專案的 DefaultGame.ini 中宣告初始化設定。 這是 Windows 上唯一真正需要手動處理的步驟,而外掛提供的是空白值。在此 PackageName 是套件名稱的唯一來源,因為引擎沒有對應設定。若留空,初始化會記錄錯誤並改用專案名稱。
  2. 確認部署的啟動器與你的遊戲相符。 深層連結註冊會依據啟動器的確切檔名,而曾有套件隨附的啟動器是以其他遊戲命名。若 DLL 旁的 .exe 不是你的,深層連結將無法解析。

构建脚本会将 VNGGamesSDK.dllvnggamessdk.dat 部署到游戏可执行文件旁边。该 DLL 采用延迟加载并在运行时解析,因此不需要链接导入库。

.dat 是你游戏的加密配置文件,已包含在导出内容中,因此不需要手动替换。你需要做的是:

  1. 在项目的 DefaultGame.ini 中声明初始化配置。 这是 Windows 上唯一真正需要手动处理的步骤,而插件提供的是空白值。在此 PackageName 是包名的唯一来源,因为引擎没有对应设置。若留空,初始化会记录错误并改用项目名称。
  2. 确认部署的启动器与你的游戏匹配。 深度链接注册会依据启动器的确切文件名,而曾有包随附的启动器是以其他游戏命名。若 DLL 旁的 .exe 不是你的,深度链接将无法解析。
[VNGGamesSDK.InitConfig]
; The ONLY source for packageName on Windows. Always set it for production.
PackageName=com.yourcompany.yourgame
; Fallback for gameVersion. ProjectVersion is checked first.
GameVersion=1.0.0
; Passed through to the native SDK.
MaxInstances=0

Verify the integration

Turn on the SDK’s log category, then run the game and confirm initialization reports success.

開啟 SDK 的記錄類別,接著執行遊戲並確認初始化回報成功。

开启 SDK 的日志类别,然后运行游戏并确认初始化报告成功。

[Core.Log]
LogVGSDK=all
 
[Core.System]
LogVGSDK=VeryVerbose

Editor and other non-packaged builds fall back to the plugin’s default platform helper, which only logs. No SDK call reaches a native SDK there, so verify on a packaged build for the target you care about.

編輯器與其他未打包的建置會退回外掛的預設平台輔助程式,該程式僅輸出記錄。在這類環境中沒有任何 SDK 呼叫會到達原生 SDK,因此請在你關注之目標平台的打包版本上進行驗證。

编辑器与其他未打包的构建会回退到插件的默认平台辅助程序,该程序仅输出日志。在这类环境中没有任何 SDK 调用会到达原生 SDK,因此请在你关注的目标平台的打包版本上进行验证。

Initialization

The plugin initializes the SDK for you: its module calls into the native SDK as soon as it loads, so there is no init call to make. On the Android and iOS build targets that is synchronous. On the Windows target it is asynchronous, so wait for the signal below before calling any other feature.

外掛會自行初始化 SDK:模組載入時就會呼叫原生 SDK,因此你不需要自行呼叫初始化。在 Android 與 iOS 建置目標上,這個過程是同步的。在 Windows 目標上則為非同步,因此請先等待下方的訊號,再呼叫其他任何功能。

插件会自行初始化 SDK:模块加载时就会调用原生 SDK,因此你不需要自行调用初始化。在 Android 与 iOS 构建目标上,这个过程是同步的。在 Windows 目标上则为异步,因此请先等待下方的信号,再调用其他任何功能。

Wait for initialization

Windows

Registers a listener that fires once the SDK has finished initializing.

註冊一個監聽器,在 SDK 完成初始化時觸發。

注册一个监听器,在 SDK 完成初始化时触发。

The plugin initializes itself when its module loads, so there is no init call to make. On the Windows build target that initialization is asynchronous, so gate your first feature call on this signal. Registering after initialization has already completed fires the listener immediately.

外掛會在模組載入時自行初始化,因此沒有需要你呼叫的初始化方法。在 Windows 建置目標上,初始化是非同步的,因此請先等待此訊號,再進行第一個功能呼叫。若在初始化完成之後才註冊,監聽器會立即觸發。

插件会在模块加载时自行初始化,因此没有需要你调用的初始化方法。在 Windows 构建目标上,初始化是异步的,因此请先等待此信号,再进行第一个功能调用。若在初始化完成之后才注册,监听器会立即触发。

// The plugin auto-initializes on module load, so you only register for the result.
// Late-subscriber safe: if init already finished, this fires immediately.
VGSDKWrapper::GetInstance()->SetOnInitCompletedListener(
    [](bool bSuccess, const FVGSDKError& Error)
    {
        if (bSuccess)
        {
            // Safe to call any SDK feature from here on.
        }
    });
 
// Or poll, if you would rather gate a tick:
const bool bReady = VGSDKWrapper::GetInstance()->IsInitialized();

Input

輸入

输入

FieldTypeDescription
ListenerTFunction<void(bool, const FVGSDKError&)>C++ only: the callback invoked once initialization resolves. Registering a second listener replaces the first, since the wrapper keeps a single slot.
欄位型別說明
ListenerTFunction<void(bool, const FVGSDKError&)>僅限 C++:初始化完成時呼叫的回呼。再次註冊會取代前一個,因為包裝層只保留單一插槽。
字段类型描述
ListenerTFunction<void(bool, const FVGSDKError&)>仅限 C++:初始化完成时调用的回调。再次注册会取代前一个,因为包装层只保留单一插槽。

Output

輸出

输出

FieldTypeDescription
Successbooltrue when the SDK initialized successfully. false means initialization failed and Error carries the reason.
ErrorFVGSDKErrorThe failure reason when Success is false. See Unreal plugin error codes.
欄位型別說明
SuccessboolSDK 初始化成功時為 true。為 false 表示初始化失敗,Error 會帶有原因。
ErrorFVGSDKErrorSuccessfalse 時的失敗原因。請參閱 Unreal 外掛錯誤碼
字段类型描述
SuccessboolSDK 初始化成功时为 true。为 false 表示初始化失败,Error 会带有原因。
ErrorFVGSDKErrorSuccessfalse 时的失败原因。请参阅 Unreal 插件错误码

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

Windows

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

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

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

if (IVGSDKPlatformHelper* Helper = VGSDKWrapper::GetInstance()->GetAndroidHelper())
{
    Helper->ShowLoginForm(
        [](const TVariant<FVGSDKUserInfo, FVGSDKError>& Result)
        {
            // Same result shape as Auto login.
        });
}

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。

Output

輸出

输出

FieldTypeDescription
Successbooltrue when the player signed in. false means the Error pin carries the reason.
UserInfoFVGSDKUserInfoThe signed-in player. Fields: FVGSDKUserInfo. Default-constructed and empty on failure.
ErrorFVGSDKErrorThe failure reason when Success is false, carrying Code and Message. See Unreal plugin error codes.
欄位型別說明
Successbool玩家登入成功時為 true。為 false 表示 Error 接腳帶有原因。
UserInfoFVGSDKUserInfo已登入的玩家。欄位請參閱 FVGSDKUserInfo。失敗時為預設建構的空值。
ErrorFVGSDKErrorSuccessfalse 時的失敗原因,帶有 CodeMessage。請參閱 Unreal 外掛錯誤碼
字段类型描述
Successbool玩家登录成功时为 true。为 false 表示 Error 引脚带有原因。
UserInfoFVGSDKUserInfo已登录的玩家。字段请参阅 FVGSDKUserInfo。失败时为默认构造的空值。
ErrorFVGSDKErrorSuccessfalse 时的失败原因,带有 CodeMessage。请参阅 Unreal 插件错误码

Auto login

AndroidiOS

Silently re-authenticates the last-used channel if a session exists, otherwise presents the login form.

若已存在工作階段,會以最近使用的頻道靜默重新驗證。否則顯示登入表單。

若已存在会话,会以最近使用的渠道静默重新验证。否则显示登录表单。

VGSDKWrapper::GetInstance()->AutoLogin(
    [](const TVariant<FVGSDKUserInfo, FVGSDKError>& Result)
    {
        if (Result.IsType<FVGSDKUserInfo>())
        {
            const FVGSDKUserInfo& User = Result.Get<FVGSDKUserInfo>();
            // Signed in: User.UserId, User.DisplayName, User.SessionId
        }
        else
        {
            const FVGSDKError& Error = Result.Get<FVGSDKError>();
        }
    });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。

Output

輸出

输出

FieldTypeDescription
Successbooltrue when the player signed in. false means the Error pin carries the reason.
UserInfoFVGSDKUserInfoThe signed-in player. Fields: FVGSDKUserInfo. Default-constructed and empty on failure.
ErrorFVGSDKErrorThe failure reason when Success is false, carrying Code and Message. See Unreal plugin error codes.
欄位型別說明
Successbool玩家登入成功時為 true。為 false 表示 Error 接腳帶有原因。
UserInfoFVGSDKUserInfo已登入的玩家。欄位請參閱 FVGSDKUserInfo。失敗時為預設建構的空值。
ErrorFVGSDKErrorSuccessfalse 時的失敗原因,帶有 CodeMessage。請參閱 Unreal 外掛錯誤碼
字段类型描述
Successbool玩家登录成功时为 true。为 false 表示 Error 引脚带有原因。
UserInfoFVGSDKUserInfo已登录的玩家。字段请参阅 FVGSDKUserInfo。失败时为默认构造的空值。
ErrorFVGSDKErrorSuccessfalse 时的失败原因,带有 CodeMessage。请参阅 Unreal 插件错误码

Log out

AndroidiOSWindows

Signs the current player out and clears the stored session.

將目前的玩家登出並清除已儲存的工作階段。

将当前玩家登出并清除已保存的会话。

VGSDKWrapper::GetInstance()->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

LevelUp multiple accounts

Get account

Windows

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,让玩家在登录过程中不会不小心与其他游戏元素交互。

if (IVGSDKPlatformHelper* Helper = VGSDKWrapper::GetInstance()->GetAndroidHelper())
{
    Helper->GetAccount(
        [](const TVariant<FVGSDKUserInfo, FVGSDKError>& Result)
        {
            // Signed in with the Launcher's account, or Error on failure.
        });
}

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。

Output

輸出

输出

FieldTypeDescription
Successbooltrue when the player signed in. false means the Error pin carries the reason.
UserInfoFVGSDKUserInfoThe signed-in player. Fields: FVGSDKUserInfo. Default-constructed and empty on failure.
ErrorFVGSDKErrorThe failure reason when Success is false, carrying Code and Message. See Unreal plugin error codes.
欄位型別說明
Successbool玩家登入成功時為 true。為 false 表示 Error 接腳帶有原因。
UserInfoFVGSDKUserInfo已登入的玩家。欄位請參閱 FVGSDKUserInfo。失敗時為預設建構的空值。
ErrorFVGSDKErrorSuccessfalse 時的失敗原因,帶有 CodeMessage。請參閱 Unreal 外掛錯誤碼
字段类型描述
Successbool玩家登录成功时为 true。为 false 表示 Error 引脚带有原因。
UserInfoFVGSDKUserInfo已登录的玩家。字段请参阅 FVGSDKUserInfo。失败时为默认构造的空值。
ErrorFVGSDKErrorSuccessfalse 时的失败原因,带有 CodeMessage。请参阅 Unreal 插件错误码

Select account

Windows

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

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

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

if (IVGSDKPlatformHelper* Helper = VGSDKWrapper::GetInstance()->GetAndroidHelper())
{
    Helper->SelectAccount(
        [](const TVariant<FVGSDKUserInfo, FVGSDKError>& Result)
        {
            // Result carries the newly selected account.
        });
}

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。

Output

輸出

输出

FieldTypeDescription
Successbooltrue when the player signed in. false means the Error pin carries the reason.
UserInfoFVGSDKUserInfoThe signed-in player. Fields: FVGSDKUserInfo. Default-constructed and empty on failure.
ErrorFVGSDKErrorThe failure reason when Success is false, carrying Code and Message. See Unreal plugin error codes.
欄位型別說明
Successbool玩家登入成功時為 true。為 false 表示 Error 接腳帶有原因。
UserInfoFVGSDKUserInfo已登入的玩家。欄位請參閱 FVGSDKUserInfo。失敗時為預設建構的空值。
ErrorFVGSDKErrorSuccessfalse 時的失敗原因,帶有 CodeMessage。請參閱 Unreal 外掛錯誤碼
字段类型描述
Successbool玩家登录成功时为 true。为 false 表示 Error 引脚带有原因。
UserInfoFVGSDKUserInfo已登录的玩家。字段请参阅 FVGSDKUserInfo。失败时为默认构造的空值。
ErrorFVGSDKErrorSuccessfalse 时的失败原因,带有 CodeMessage。请参阅 Unreal 插件错误码

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 获取可售商品。

TArray<FString> ProductIds = { TEXT("item-1"), TEXT("item-2") };
 
VGSDKWrapper::GetInstance()->FetchPaymentProductList(ProductIds,
    [](const TVariant<TArray<FVGSDKPaymentProduct>, FVGSDKError>& Result)
    {
        if (Result.IsType<TArray<FVGSDKPaymentProduct>>())
        {
            for (const FVGSDKPaymentProduct& Product : Result.Get<TArray<FVGSDKPaymentProduct>>())
            {
                // Show Product.DisplayPrice in your shop UI.
            }
        }
    });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
ProductIdsTArray<FString>List of configured item id from Store.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
ProductIdsTArray<FString>在商店設定的商品 id 清單。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。
ProductIdsTArray<FString>在商店配置的商品 id 列表。

Output

輸出

输出

FieldTypeDescription
bSuccessbooltrue when the product list was fetched.
ProductsTArray<FVGSDKPaymentProduct>The products found. Empty when no id matched. Each entry: FVGSDKPaymentProduct.
ErrorFVGSDKErrorThe failure reason when bSuccess is false. See Unreal plugin error codes.
欄位型別說明
bSuccessbool成功取得商品清單時為 true
ProductsTArray<FVGSDKPaymentProduct>找到的商品。沒有符合的 ID 時為空。每個項目:FVGSDKPaymentProduct
ErrorFVGSDKErrorbSuccessfalse 時的失敗原因。請參閱 Unreal 外掛錯誤碼
字段类型描述
bSuccessbool成功获取商品列表时为 true
ProductsTArray<FVGSDKPaymentProduct>找到的商品。没有匹配的 ID 时为空。每个条目:FVGSDKPaymentProduct
ErrorFVGSDKErrorbSuccessfalse 时的失败原因。请参阅 Unreal 插件错误码

Purchase

AndroidiOS

Runs a purchase and reports the outcome. Build the request with the purchase-info object: all fields required.

執行購買並回報結果。使用購買資訊物件建立請求: 所有欄位皆為必填。

执行购买并报告结果。使用购买信息对象构建请求: 所有字段均为必填。

FVGSDKPaymentInfo PaymentInfo;
PaymentInfo.UserID     = TEXT("user-1");
PaymentInfo.ServerID   = TEXT("server-1");
PaymentInfo.ItemID     = TEXT("item-1");
PaymentInfo.RoleID     = TEXT("role-1");
PaymentInfo.AppTransID = TEXT("txn-1");
PaymentInfo.Amount     = 10000.0;
 
VGSDKWrapper::GetInstance()->Pay(PaymentInfo,
    []()                        { /* granted */ },
    []()                        { /* processing */ },
    []()                        { /* player canceled */ },
    [](const FString& Message)  { /* failed */ });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
PaymentInfoFVGSDKPaymentInfoThe purchase request. Full model: FVGSDKPaymentInfo.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
PaymentInfoFVGSDKPaymentInfo購買請求。完整模型請參閱 FVGSDKPaymentInfo
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。
PaymentInfoFVGSDKPaymentInfo购买请求。完整模型请参阅 FVGSDKPaymentInfo

Output

輸出

输出

FieldTypeDescription
OnSuccessFStringPurchase completed.
OnProcessingFStringProcessing / verifying with Billing System.
OnCancelFStringPlayer canceled.
OnFailFStringPurchase failed. See billing / store payment error codes.
欄位型別說明
OnSuccessFString購買完成。
OnProcessingFString由帳務系統處理/驗證中。
OnCancelFString玩家已取消。
OnFailFString購買失敗。請參閱 帳務商店 付款錯誤碼。
字段类型描述
OnSuccessFString购买完成。
OnProcessingFString由计费系统处理/验证中。
OnCancelFString玩家已取消。
OnFailFString购买失败。请参阅 计费商店 支付错误码。

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.

請先執行此檢查,再呼叫「驗證獎勵」。它只回報是否有獎勵,本身不會發放任何內容。

请先执行此检查,再调用“验证奖励”。它只报告是否有奖励,本身不会发放任何内容。

VGSDKWrapper::GetInstance()->CheckItemReward(
    [](bool bIsHasReward)
    {
        if (bIsHasReward)
        {
            // Show the claim entry point, then call Verify reward.
        }
    },
    [](const FString& Message) { /* check failed */ });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。

Output

輸出

输出

FieldTypeDescription
bIsHasRewardbooltrue when the player has a reward waiting to be granted.
MessageFStringOn the failure pin, the reason the check could not complete.
欄位型別說明
bIsHasRewardbool玩家有待發放的獎勵時為 true
MessageFString在失敗接腳上,表示檢查無法完成的原因。
字段类型描述
bIsHasRewardbool玩家有待发放的奖励时为 true
MessageFString在失败引脚上,表示检查无法完成的原因。

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.

請僅在「檢查道具獎勵」回報有待發放的獎勵之後才呼叫。

请仅在“检查道具奖励”报告有待发放的奖励之后才调用。

FVGSDKRewardInfo RewardInfo;
RewardInfo.UserID     = TEXT("user-1");
RewardInfo.ServerID   = TEXT("server-1");
RewardInfo.RoleID     = TEXT("role-1");
RewardInfo.AppTransID = TEXT("txn-1");
 
VGSDKWrapper::GetInstance()->VerifyReward(RewardInfo,
    [](const FString& Message) { /* granted */ },
    [](const FString& Message) { /* retry later */ },
    [](const FString& Message) { /* do not retry */ });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
RewardInfoFVGSDKRewardInfoThe reward claim. Full model: FVGSDKRewardInfo.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
RewardInfoFVGSDKRewardInfo獎勵領取請求。完整模型請參閱 FVGSDKRewardInfo
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。
RewardInfoFVGSDKRewardInfo奖励领取请求。完整模型请参阅 FVGSDKRewardInfo

Output

輸出

输出

FieldTypeDescription
OnSuccessFStringThe reward was granted.
OnFailRetryFStringThe grant failed in a way that is safe to retry with the same request.
OnFailNonRetryFStringThe grant failed permanently. Do not retry with the same request.
欄位型別說明
OnSuccessFString獎勵已發放。
OnFailRetryFString發放因暫時性問題失敗。以相同請求重試是安全的。
OnFailNonRetryFString發放永久失敗。請勿以相同請求重試。
字段类型描述
OnSuccessFString奖励已发放。
OnFailRetryFString发放因临时性问题失败。以相同请求重试是安全的。
OnFailNonRetryFString发放永久失败。请勿以相同请求重试。

Analytics

One facade for every analytics provider. The plugin exposes the custom-event calls only: Send a custom event, where you name the providers, and Misc: custom event, which sends to the SDK’s default provider set. The native SDKs’ structured use-case funnels (conversion rate, onboarding, main and daily activities, social and communities) have no plugin entry point, so report those moments as custom events of your own. 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.

涵蓋所有分析供應商的單一門面。外掛僅提供自訂事件呼叫:Send a custom event 由你自行指定供應商,Misc: custom event 則傳送至 SDK 的預設供應商集合。原生 SDK 的結構化使用情境漏斗(conversion rate、onboarding、main and daily activities、social and communities)在外掛中沒有對應的進入點,因此請以你自己的自訂事件回報這些時機。供應商:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每個呼叫都是 fire-and-forget。每個事件還會帶有一組由 SDK 自動填入的預設參數: 請參閱 分析預設參數

注意: VNGGames SDK API 觸發的每個事件都以 vgsdk_ 前綴開頭,並遵循 vgsdk_{prefix}_{event name} 公式: 例如 vgsdk_af_app_open。請參閱 分析平台前綴

面向所有分析提供方的统一门面。插件仅提供自定义事件调用:Send a custom event 由你自行指定提供方,Misc: custom event 则发送到 SDK 的默认提供方集合。原生 SDK 的结构化使用场景漏斗(conversion rate、onboarding、main and daily activities、social and communities)在插件中没有对应的入口,因此请用你自己的自定义事件回报这些时机。提供方:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每次调用都是 fire-and-forget。每个事件还会携带一组由 SDK 自动填充的默认参数: 请参阅 分析默认参数

注意: VNGGames SDK API 触发的每个事件都以 vgsdk_ 前缀开头,并遵循公式 vgsdk_{prefix}_{event name}: 例如 vgsdk_af_app_open。请参阅 分析平台前缀

Custom event

Send a custom event

AndroidiOSWindows

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

On the Windows build target the native layer takes a provider bitmask that supports only AppsFlyer, DataPlatform and ThinkingData. Firebase, Facebook and CleverTap are dropped while the mask is built. That is not an error, so the event still reaches the supported providers you listed and the others receive nothing.

在 Windows 建置目標上,原生層採用供應商位元遮罩,僅支援 AppsFlyerDataPlatformThinkingDataFirebaseFacebookCleverTap 會在建立遮罩時被略過。這並不算錯誤,因此事件仍會送達你列出的受支援供應商,其餘則收不到任何內容。

在 Windows 构建目标上,原生层采用提供方位掩码,仅支持 AppsFlyerDataPlatformThinkingDataFirebaseFacebookCleverTap 会在构建掩码时被跳过。这并不算错误,因此事件仍会送达你列出的受支持提供方,其余则收不到任何内容。

TMap<FString, FString> Parameters;
Parameters.Add(TEXT("level"), TEXT("10"));
 
TArray<FVGSDKAnalyticsPlatform> Platforms;
Platforms.Add(FVGSDKAnalyticsPlatform(EVGSDKAnalyticsProvider::AppsFlyer, TEXT("af")));
 
VGSDKWrapper::GetInstance()->SendCustomEvent(TEXT("level_up"), Parameters, Platforms);

Input

輸入

输入

FieldTypeDescription
EventNameFStringEvent name.
ParametersTMap<FString, FString>Event parameters.
PlatformsTArray<FVGSDKAnalyticsPlatform>Target providers. Each entry selects a provider + event-name prefix.
Platforms[].ProviderEVGSDKAnalyticsProviderProvider to send to: see VGSDKAnalyticsProvider.
Platforms[].PrefixFStringPrefix prepended to the event name for that provider.
欄位型別說明
EventNameFString事件名稱。
ParametersTMap<FString, FString>事件參數。
PlatformsTArray<FVGSDKAnalyticsPlatform>目標供應商。每個項目會選定一個供應商與事件名稱前綴。
Platforms[].ProviderEVGSDKAnalyticsProvider要傳送的目標供應商:請參閱 VGSDKAnalyticsProvider
Platforms[].PrefixFString為該供應商加在事件名稱前的前綴。
字段类型描述
EventNameFString事件名称。
ParametersTMap<FString, FString>事件参数。
PlatformsTArray<FVGSDKAnalyticsPlatform>目标提供方。每个条目会选定一个提供方与事件名称前缀。
Platforms[].ProviderEVGSDKAnalyticsProvider要发送的目标提供方:请参阅 VGSDKAnalyticsProvider
Platforms[].PrefixFString为该提供方加在事件名称前的前缀。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Misc: custom event

AndroidiOSWindows

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

TMap<FString, FString> Parameters;
Parameters.Add(TEXT("level"), TEXT("10"));
 
VGSDKWrapper::GetInstance()->MiscCustomEvent(TEXT("level_up"), Parameters);

Input

輸入

输入

FieldTypeDescription
EventNameFStringEvent name.
ParametersTMap<FString, FString>Event parameters.
欄位型別說明
EventNameFString事件名稱。
ParametersTMap<FString, FString>事件參數。
字段类型描述
EventNameFString事件名称。
ParametersTMap<FString, FString>事件参数。

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.

為玩家顯示支援中心。

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

FCustomerSupportInfo SupportInfo;
SupportInfo.UserId    = TEXT("user-1");
SupportInfo.ServerId  = TEXT("server-1");
SupportInfo.RoleName  = TEXT("role");
SupportInfo.Level     = TEXT("10");
SupportInfo.Guild     = TEXT("guild");
SupportInfo.LoginType = TEXT("GG");
SupportInfo.Content   = TEXT("Need help");
 
VGSDKWrapper::GetInstance()->ShowCustomerSupport(SupportInfo,
    [](const TVariant<bool, FVGSDKError>& Result) { });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
InfoFCustomerSupportInfoPlayer context. Full model: FCustomerSupportInfo.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
InfoFCustomerSupportInfo玩家情境。完整模型請參閱 FCustomerSupportInfo
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。
InfoFCustomerSupportInfo玩家上下文。完整模型请参阅 FCustomerSupportInfo

Output

輸出

输出

FieldTypeDescription
bSuccessbooltrue when the support center opened.
ErrorFVGSDKErrorThe failure reason when bSuccess is false. See Unreal plugin error codes.
欄位型別說明
bSuccessbool客服中心成功開啟時為 true
ErrorFVGSDKErrorbSuccessfalse 時的失敗原因。請參閱 Unreal 外掛錯誤碼
字段类型描述
bSuccessbool客服中心成功打开时为 true
ErrorFVGSDKErrorbSuccessfalse 时的失败原因。请参阅 Unreal 插件错误码

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

Firebase

Fetch Firebase Remote Config

AndroidiOS

Fetches all remote-config keys.

取得所有 remote-config 鍵。

获取所有 remote-config 键。

VGSDKWrapper::GetInstance()->FetchFirebaseConfig(
    [](const TVariant<TMap<FString, FString>, FVGSDKError>& Result)
    {
        if (Result.IsType<TMap<FString, FString>>())
        {
            const TMap<FString, FString>& Config = Result.Get<TMap<FString, FString>>();
            // Read Config["your_key"]
        }
    });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。

Output

輸出

输出

FieldTypeDescription
bSuccessbooltrue when the fetch succeeded.
ConfigDataFVGSDKConfigDataAll remote-config keys and values. Blueprint receives the wrapper struct, whose ConfigMap holds the pairs. The C++ callback receives the TMap<FString, FString> directly.
ErrorFVGSDKErrorThe failure reason when bSuccess is false. See Unreal plugin error codes.
欄位型別說明
bSuccessbool取得成功時為 true
ConfigDataFVGSDKConfigData所有遠端設定的鍵與值。Blueprint 收到的是包裝結構,其 ConfigMap 存放這些配對。C++ 回呼則直接收到 TMap<FString, FString>
ErrorFVGSDKErrorbSuccessfalse 時的失敗原因。請參閱 Unreal 外掛錯誤碼
字段类型描述
bSuccessbool获取成功时为 true
ConfigDataFVGSDKConfigData所有远程配置的键与值。Blueprint 收到的是包装结构,其 ConfigMap 存放这些键值对。C++ 回调则直接收到 TMap<FString, FString>
ErrorFVGSDKErrorbSuccessfalse 时的失败原因。请参阅 Unreal 插件错误码

In-App WebView

Show in-app WebView

AndroidiOS

Opens a URL in an in-app WebView.

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

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

VGSDKWrapper::GetInstance()->ShowWebView(TEXT("https://example.com"),
    [](const TVariant<bool, FVGSDKError>& Result) { });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
UrlFStringURL to load.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
UrlFString要載入的網址。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。
UrlFString要加载的网址。

Output

輸出

输出

FieldTypeDescription
bSuccessbooltrue when the WebView opened.
ErrorFVGSDKErrorThe failure reason when bSuccess is false. See Unreal plugin error codes.
欄位型別說明
bSuccessboolWebView 成功開啟時為 true
ErrorFVGSDKErrorbSuccessfalse 時的失敗原因。請參閱 Unreal 外掛錯誤碼
字段类型描述
bSuccessboolWebView 成功打开时为 true
ErrorFVGSDKErrorbSuccessfalse 时的失败原因。请参阅 Unreal 插件错误码

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 回调仅返回一个错误(不存在 = 成功)。

Share photo to Facebook

AndroidiOS

Shares a photo through the Facebook share dialog.

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

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

VGSDKWrapper::GetInstance()->ShareFacebookPhoto(Base64Image,
    [](const FString& Message) { /* shared */ },
    [](const FString& Message) { /* failed */ },
    []()                       { /* canceled */ });

Input

輸入

输入

FieldTypeDescription
WorldContextUObject*Blueprint only: the node’s World Context pin, normally wired from Self. The C++ entry points take no world context.
Base64ImageFStringThe photo to share, encoded as a Base64 string. The plugin decodes it to a native image before handing it to the Facebook share dialog.
欄位型別說明
WorldContextUObject*僅限 Blueprint:節點的 World Context 接腳,通常由 Self 連入。C++ 進入點不需要 world context。
Base64ImageFString要分享的照片,以 Base64 字串編碼。外掛會先解碼為原生影像,再交給 Facebook 分享對話框。
字段类型描述
WorldContextUObject*仅限 Blueprint:节点的 World Context 引脚,通常由 Self 连入。C++ 入口点不需要 world context。
Base64ImageFString要分享的照片,以 Base64 字符串编码。插件会先解码为原生图像,再交给 Facebook 分享对话框。

Output

輸出

输出

FieldTypeDescription
OnSuccessFStringThe photo was shared.
OnFailFStringThe share failed, with the reason.
OnCancel(no parameters)The player dismissed the share dialog.
欄位型別說明
OnSuccessFString相片已分享。
OnFailFString分享失敗,並附上原因。
OnCancel(no parameters)玩家關閉了分享對話框。
字段类型描述
OnSuccessFString照片已分享。
OnFailFString分享失败,并附上原因。
OnCancel(no parameters)玩家关闭了分享对话框。

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

觸發原生應用程式內評論表單(受作業系統的顯示限制約束)。

触发原生应用内评价面板(受操作系统的展示限制约束)。

VGSDKWrapper::GetInstance()->Rating();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

No return value (fire-and-forget).

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

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

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 user

AndroidiOSWindows

Returns the signed-in user, or none when no session exists.

傳回已登入的使用者。若不存在工作階段則為無。

返回已登录的用户,若不存在会话则为无。

const FVGSDKUserInfo User = VGSDKWrapper::GetInstance()->GetCurrentUserInfo();
if (!User.UserId.IsEmpty())
{
    // Signed in.
}

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
UserInfoFVGSDKUserInfoThe signed-in user, or absent when no session exists. Fields: FVGSDKUserInfo. Returns a default-constructed struct with an empty UserId when no session exists.
欄位型別說明
UserInfoFVGSDKUserInfo已登入的使用者,若無工作階段則為空。欄位請參閱 FVGSDKUserInfo。沒有工作階段時,會回傳 UserId 為空字串的預設結構。
字段类型描述
UserInfoFVGSDKUserInfo已登录的用户,若无会话则为空。字段请参阅 FVGSDKUserInfo。没有会话时,会返回 UserId 为空字符串的默认结构。

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

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.
Unknown6Default value on a default-constructed FVGSDKAnalyticsPlatform. Set a real provider before sending.
欄位型別說明
AppsFlyer0AppsFlyer。
Firebase1Firebase Analytics。
DataPlatform2VNGGames Data Platform。
Facebook3Facebook App Events。
ThinkingData4ThinkingData。
CleverTap5CleverTap。
Unknown6預設建構的 FVGSDKAnalyticsPlatform 上的預設值。傳送前請先設定實際的供應商。
字段类型描述
AppsFlyer0AppsFlyer。
Firebase1Firebase Analytics。
DataPlatform2VNGGames 数据平台。
Facebook3Facebook App Events。
ThinkingData4ThinkingData。
CleverTap5CleverTap。
Unknown6默认构造的 FVGSDKAnalyticsPlatform 上的默认值。发送前请先设置实际的提供方。

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。

FVGSDKUserInfo

The signed-in player, delivered by every login callback and by the current-user accessor.

由每個登入回呼以及目前使用者存取器傳回的使用者物件。

由每个登录回调以及当前用户访问器返回的用户对象。

Fields

欄位

字段

FieldTypeDescription
UserIdFStringUnique VNGGames user id.
SessionIdFStringSession token used to authenticate backend calls.
SocialIdFStringChannel-side social account id.
OpenIdFStringPer-game open id for the signed-in account.
OauthenFStringOAuth token issued for the session.
DisplayNameFStringPlayer display name.
LoginChannelFVGSDKLoginChannelChannel the player signed in with. See FVGSDKLoginChannel.
LoginChannelStringFStringThe login channel as a string.
EmailFStringEmail address when the channel provides one.
ProtectedStatusboolWhether the account is protected/secured.
LastUpdateSessionintEpoch seconds of the last session refresh.
AvatarUrlFStringProfile picture URL. Populated on the Windows build target only, and empty on Android and iOS.
LoginPlatformFStringName of the platform the session was created on. Populated on the Windows build target only, and empty on Android and iOS.
欄位型別說明
UserIdFString唯一的 VNGGames 使用者 ID。
SessionIdFString用於驗證後端呼叫的工作階段權杖。
SocialIdFString頻道端的社群帳號 ID。
OpenIdFString已登入帳號在此遊戲中的 open ID。
OauthenFString本次工作階段核發的 OAuth 權杖。
DisplayNameFString玩家顯示名稱。
LoginChannelFVGSDKLoginChannel玩家登入所使用的頻道。請參閱 FVGSDKLoginChannel
LoginChannelStringFString以字串表示的登入頻道。
EmailFString頻道有提供時的電子郵件地址。
ProtectedStatusbool帳號是否已受保護。
LastUpdateSessionint最近一次更新工作階段的時間。
AvatarUrlFString個人頭像網址。僅在 Windows 建置目標上有值,在 Android 與 iOS 上為空字串。
LoginPlatformFString建立此工作階段的平台名稱。僅在 Windows 建置目標上有值,在 Android 與 iOS 上為空字串。
字段类型描述
UserIdFString唯一的 VNGGames 用户 ID。
SessionIdFString用于验证后端调用的会话令牌。
SocialIdFString渠道端的社交账号 ID。
OpenIdFString已登录账号在本游戏中的 open ID。
OauthenFString本次会话签发的 OAuth 令牌。
DisplayNameFString玩家显示名称。
LoginChannelFVGSDKLoginChannel玩家登录所使用的渠道。请参阅 FVGSDKLoginChannel
LoginChannelStringFString以字符串表示的登录渠道。
EmailFString渠道提供时的电子邮件地址。
ProtectedStatusbool账号是否已受保护。
LastUpdateSessionint最近一次更新会话的时间。
AvatarUrlFString头像地址。仅在 Windows 构建目标上有值,在 Android 与 iOS 上为空字符串。
LoginPlatformFString创建该会话的平台名称。仅在 Windows 构建目标上有值,在 Android 与 iOS 上为空字符串。

FVGSDKLoginChannel

Login channel the player signed in with. Unlike the other platforms’ plain enums this is a struct pairing a numeric Value with a short string Type, and the Field / Type columns below are those two values. FromValue and FromType look a channel up and fall back to Unknown.

玩家登入所使用的頻道。與其他平台的單純列舉不同,這是一個結構,將數值 Value 與短字串 Type 配成一組,下表的「欄位」與「型別」兩欄即為這兩個值。FromValueFromType 用於查詢頻道,查不到時會回傳 Unknown

玩家登录所使用的渠道。与其他平台的普通枚举不同,这是一个结构体,将数值 Value 与短字符串 Type 配成一组,下表的“字段”与“类型”两列即为这两个值。FromValueFromType 用于查询渠道,查不到时会返回 Unknown

Fields

欄位

字段

FieldTypeDescription
Facebook1Facebook. Type is FB.
Google3Google. Type is GG.
ZingID4Zing ID. Type is ZM.
Guest5Anonymous guest. Type is GU.
Apple7Sign in with Apple. Type is AP.
Email8Email. Type is EM.
GGID10GGID. Type is GGID.
Phone11Phone number. Type is PH.
Unknown0No channel resolved. Type is Unknown, and both lookups fall back to this.
欄位型別說明
Facebook1Facebook。TypeFB
Google3Google。TypeGG
ZingID4Zing ID。TypeZM
Guest5匿名訪客。TypeGU
Apple7透過 Apple 登入。TypeAP
Email8電子郵件。TypeEM
GGID10GGID。TypeGGID
Phone11手機號碼。TypePH
Unknown0未解析出任何頻道。TypeUnknown,兩種查詢方式都會退回此值。
字段类型描述
Facebook1Facebook。TypeFB
Google3Google。TypeGG
ZingID4Zing ID。TypeZM
Guest5匿名访客。TypeGU
Apple7通过 Apple 登录。TypeAP
Email8电子邮件。TypeEM
GGID10GGID。TypeGGID
Phone11手机号码。TypePH
Unknown0未解析出任何渠道。TypeUnknown,两种查询方式都会回退到此值。

FVGSDKPaymentProduct

A sellable product returned by Get products.

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

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

Fields

欄位

字段

FieldTypeDescription
ProductIdFStringThe configured item id from Store.
TypeFStringStore product type.
PriceFStringPrice as reported by the store, as a string.
DisplayPriceFStringStore-formatted price string to show the player.
PriceMicrosFStringPrice in micro-units, as a string: 1,000,000 = one currency unit.
CurrencyFStringISO currency code.
CurrencySymbolFStringCurrency symbol for the price.
TitleFStringStore product title.
DescriptionFStringStore product description.
欄位型別說明
ProductIdFString在商店設定的商品 id。
TypeFString商店商品類型。
PriceFString商店回報的價格,以字串表示。
DisplayPriceFString商店格式化後、用於向玩家顯示的價格字串。
PriceMicrosFString以百萬分之一為單位的價格,以字串表示:1,000,000 等於一個 currency 單位。
CurrencyFStringISO 貨幣代碼。
CurrencySymbolFString價格所用的貨幣符號。
TitleFString商店商品標題。
DescriptionFString商店商品說明。
字段类型描述
ProductIdFString在商店配置的商品 id。
TypeFString商店商品类型。
PriceFString商店返回的价格,以字符串表示。
DisplayPriceFString商店格式化后、用于向玩家展示的价格字符串。
PriceMicrosFString以百万分之一为单位的价格,以字符串表示:1,000,000 等于一个 currency 单位。
CurrencyFStringISO 货币代码。
CurrencySymbolFString价格所用的货币符号。
TitleFString商店商品标题。
DescriptionFString商店商品说明。

FVGSDKPaymentInfo

The purchase request passed to Purchase.

傳入「購買」的購買請求。

传入“购买”的购买请求。

Fields

欄位

字段

FieldTypeDescription
UserIDFStringBuyer’s VNGGames user id.
ServerIDFStringGame server id.
ItemIDFStringThe configured item id from Store.
RoleIDFStringCharacter/role id.
AppTransIDFStringYour app-side transaction id, for reconciliation.
AppTxIDFStringSecondary app-side transaction id, passed through to the billing system.
AddInfoFStringExtra passthrough data. Empty string when unused.
AmountdoublePurchase amount. Defaults to 0.0.
ItemDisplayNameFStringItem name to show in the purchase UI.
DescriptionFStringPurchase description.
ClientKeyFStringOptional signing key. Leave empty unless your integration requires it.
SecretKeyFStringOptional signing secret. Leave empty unless your integration requires it.
欄位型別說明
UserIDFString購買者的 VNGGames 使用者 ID。
ServerIDFString遊戲伺服器 ID。
ItemIDFString在商店設定的商品 id。
RoleIDFString角色 ID。
AppTransIDFString你的應用程式端交易 ID,用於對帳。
AppTxIDFString次要的應用程式端交易 ID,會一併傳遞給計費系統。
AddInfoFString額外的傳遞資料。未使用時請傳入空字串。
Amountdouble購買金額。預設為 0.0
ItemDisplayNameFString在購買介面中顯示的道具名稱。
DescriptionFString購買說明。
ClientKeyFString選填的簽章金鑰。除非你的整合需要,否則請留空。
SecretKeyFString選填的簽章密鑰。除非你的整合需要,否則請留空。
字段类型描述
UserIDFString购买者的 VNGGames 用户 ID。
ServerIDFString游戏服务器 ID。
ItemIDFString在商店配置的商品 id。
RoleIDFString角色 ID。
AppTransIDFString你的应用端交易 ID,用于对账。
AppTxIDFString次要的应用端交易 ID,会一并传递给计费系统。
AddInfoFString额外的透传数据。未使用时请传入空字符串。
Amountdouble购买金额。默认为 0.0
ItemDisplayNameFString在购买界面中显示的道具名称。
DescriptionFString购买说明。
ClientKeyFString选填的签名密钥。除非你的集成需要,否则请留空。
SecretKeyFString选填的签名密钥。除非你的集成需要,否则请留空。

FVGSDKRewardInfo

The reward claim passed to Verify reward.

傳入「驗證獎勵」的獎勵領取請求。

传入“验证奖励”的奖励领取请求。

Fields

欄位

字段

FieldTypeDescription
UserIDFStringBuyer’s VNGGames user id.
ServerIDFStringGame server id.
RoleIDFStringCharacter/role id.
AppTransIDFStringYour app-side transaction id, for reconciliation.
AddInfoFStringExtra passthrough data. Empty string when unused.
欄位型別說明
UserIDFString購買者的 VNGGames 使用者 ID。
ServerIDFString遊戲伺服器 ID。
RoleIDFString角色 ID。
AppTransIDFString你的應用程式端交易 ID,用於對帳。
AddInfoFString額外的傳遞資料。未使用時請傳入空字串。
字段类型描述
UserIDFString购买者的 VNGGames 用户 ID。
ServerIDFString游戏服务器 ID。
RoleIDFString角色 ID。
AppTransIDFString你的应用端交易 ID,用于对账。
AddInfoFString额外的透传数据。未使用时请传入空字符串。

FCustomerSupportInfo

Player context passed to Open support center.

傳入「開啟客服中心」的玩家情境。

传入“打开客服中心”的玩家上下文。

Fields

欄位

字段

FieldTypeDescription
UserIdFStringUnique VNGGames user id.
LoginTypeFStringLogin channel as a string, for example GG.
RoleNameFStringCharacter/role name.
LevelFStringPlayer level.
GuildFStringGuild name.
ServerIdFStringGame server id.
ContentFStringPre-filled ticket content.
欄位型別說明
UserIdFString唯一的 VNGGames 使用者 ID。
LoginTypeFString以字串表示的登入頻道,例如 GG
RoleNameFString角色名稱。
LevelFString玩家等級。
GuildFString公會名稱。
ServerIdFString遊戲伺服器 ID。
ContentFString預先填入的工單內容。
字段类型描述
UserIdFString唯一的 VNGGames 用户 ID。
LoginTypeFString以字符串表示的登录渠道,例如 GG
RoleNameFString角色名称。
LevelFString玩家等级。
GuildFString公会名称。
ServerIdFString游戏服务器 ID。
ContentFString预填的工单内容。

Error Codes

On Unreal a failure arrives as an FVGSDKError whose Code is a STRING, not a number. It is either one of the plugin’s own codes, listed under Unreal plugin codes below, or the underlying native SDK’s code forwarded verbatim. That is why the numeric bands below still apply: on the Android and iOS build targets a game really does receive those values, as strings.

在 Unreal 上,失敗會以 FVGSDKError 回傳,其 Code 是字串而非數字。它可能是外掛本身的代碼(見下方的 Unreal 外掛代碼),也可能是原封不動轉傳的原生 SDK 代碼。這也是下方數字區段依然適用的原因:在 Android 與 iOS 建置目標上,遊戲確實會收到這些值,只是以字串形式呈現。

在 Unreal 上,失败会以 FVGSDKError 返回,其 Code 是字符串而非数字。它可能是插件本身的代码(见下方的 Unreal 插件代码),也可能是原封不动转发的原生 SDK 代码。这也是下方数字区段依然适用的原因:在 Android 与 iOS 构建目标上,游戏确实会收到这些值,只是以字符串形式呈现。

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: 购买正在等待批准(延迟 / 需家长同意)。

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.
欄位型別說明
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。
字段类型描述
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。

Unreal: plugin codes

On Unreal a failure arrives as an FVGSDKError whose Code is a STRING, not a number. Two kinds reach your game. The plugin’s own codes below are raised by the UE layer before or around the native call. Anything else is the underlying native SDK’s code forwarded verbatim, so on Android and iOS you will also see the numeric mobile bands documented above, and on Windows the numeric PC bands.

在 Unreal 上,失敗會以 FVGSDKError 回傳,其 Code 是字串而非數字。你的遊戲會收到兩種來源。下方是外掛本身的代碼,由 UE 層在原生呼叫之前或周圍產生。其餘則是原封不動轉傳的原生 SDK 代碼,因此在 Android 與 iOS 上你也會看到上方記載的行動平台數字區段,在 Windows 上則是 PC 的數字區段。

在 Unreal 上,失败会以 FVGSDKError 返回,其 Code 是字符串而非数字。你的游戏会收到两种来源。下方是插件本身的代码,由 UE 层在原生调用之前或周围产生。其余则是原封不动转发的原生 SDK 代码,因此在 Android 与 iOS 上你也会看到上方记载的移动平台数字区段,在 Windows 上则是 PC 的数字区段。

Codes

錯誤碼

错误码

FieldTypeDescription
NOT_SUPPORTEDall targetsThe call is not implemented on this build target. Message: This feature is not supported!. See each method’s build-target note for which targets run it.
DLL_LOAD_ERRORWindowsVNGGamesSDK.dll was not loaded. Message: VNGGamesSDK.dll not loaded. Confirm the DLL is staged next to the game executable.
PARSE_ERRORWindowsThe native login result could not be parsed. The message quotes the unparseable payload.
JNI_INIT_ERRORAndroidThe plugin could not initialize JNI for the call.
CLASS_NOT_FOUNDAndroidA required Java class was not found. Check that the VGSDK Gradle plugin and its dependencies resolved.
CONSTRUCTOR_NOT_FOUNDAndroidA required Java constructor was not found, which usually means a native SDK version mismatch.
INSTANCE_CREATION_FAILEDAndroidA required Java object could not be constructed.
SETTER_NOT_FOUNDAndroidA required Java setter was not found, which usually means a native SDK version mismatch.
METHOD_NOT_FOUNDAndroidThe target Java method was not found, which usually means a native SDK version mismatch.
REGISTER_NATIVE_FAILEDAndroidThe plugin could not register its JNI callbacks for the call.
JNI_EXCEPTIONAndroidThe underlying Java call threw. Check logcat for the Java stack trace.
FETCH_CONFIG_FAILAndroid and iOSFirebase Remote Config could not be fetched.
欄位型別說明
NOT_SUPPORTEDall targets此建置目標未實作該呼叫。訊息為 This feature is not supported!。哪些目標會實際執行,請參閱各方法的建置目標說明。
DLL_LOAD_ERRORWindows未載入 VNGGamesSDK.dll。訊息為 VNGGamesSDK.dll not loaded。請確認該 DLL 已部署在遊戲執行檔旁邊。
PARSE_ERRORWindows無法解析原生登入結果。訊息中會引用無法解析的內容。
JNI_INIT_ERRORAndroid外掛無法為此呼叫初始化 JNI。
CLASS_NOT_FOUNDAndroid找不到必要的 Java 類別。請確認 VGSDK Gradle 外掛及其相依套件已正確解析。
CONSTRUCTOR_NOT_FOUNDAndroid找不到必要的 Java 建構式,通常表示原生 SDK 版本不符。
INSTANCE_CREATION_FAILEDAndroid無法建立必要的 Java 物件。
SETTER_NOT_FOUNDAndroid找不到必要的 Java setter,通常表示原生 SDK 版本不符。
METHOD_NOT_FOUNDAndroid找不到目標 Java 方法,通常表示原生 SDK 版本不符。
REGISTER_NATIVE_FAILEDAndroid外掛無法為此呼叫註冊其 JNI 回呼。
JNI_EXCEPTIONAndroid底層 Java 呼叫拋出例外。請查看 logcat 取得 Java 堆疊追蹤。
FETCH_CONFIG_FAILAndroid and iOS無法取得 Firebase Remote Config。
字段类型描述
NOT_SUPPORTEDall targets此构建目标未实现该调用。消息为 This feature is not supported!。哪些目标会实际执行,请参阅各方法的构建目标说明。
DLL_LOAD_ERRORWindows未加载 VNGGamesSDK.dll。消息为 VNGGamesSDK.dll not loaded。请确认该 DLL 已部署在游戏可执行文件旁边。
PARSE_ERRORWindows无法解析原生登录结果。消息中会引用无法解析的内容。
JNI_INIT_ERRORAndroid插件无法为此调用初始化 JNI。
CLASS_NOT_FOUNDAndroid找不到必要的 Java 类。请确认 VGSDK Gradle 插件及其依赖包已正确解析。
CONSTRUCTOR_NOT_FOUNDAndroid找不到必要的 Java 构造函数,通常表示原生 SDK 版本不匹配。
INSTANCE_CREATION_FAILEDAndroid无法创建必要的 Java 对象。
SETTER_NOT_FOUNDAndroid找不到必要的 Java setter,通常表示原生 SDK 版本不匹配。
METHOD_NOT_FOUNDAndroid找不到目标 Java 方法,通常表示原生 SDK 版本不匹配。
REGISTER_NATIVE_FAILEDAndroid插件无法为此调用注册其 JNI 回调。
JNI_EXCEPTIONAndroid底层 Java 调用抛出异常。请查看 logcat 获取 Java 堆栈跟踪。
FETCH_CONFIG_FAILAndroid and iOS无法获取 Firebase Remote Config。