Android Integration Guide

Everything you need to bring VNGGames to your game: sign-in, in-app purchase, analytics, ads, and player engagement: in one complete reference. Every method spells out its inputs and outputs field by field, and each one is directly linkable so you can jump straight to the call you need.

打造遊戲接入 VNGGames 所需的一切: 登入、應用程式內購買、分析、廣告與玩家互動: 全部整合於一份完整參考中。每個方法都逐一欄位說明其輸入與輸出,且每個方法都可直接連結,讓你能快速跳到所需的呼叫。

打造游戏接入 VNGGames 所需的一切: 登录、应用内购买、分析、广告与玩家互动: 全部整合于一份完整参考中。每个方法都逐一字段说明其输入与输出,且每个方法都可直接链接,让你能快速跳到所需的调用。

Get started

Prerequisites

  • VNGGames SDK package: obtain the latest VNGGames SDK zip file.
  • Supported platform: Android (API 23+).
  • Minimum Java support: Java 17+.
  • Gradle: Android Gradle Plugin 8.5.1+ (Target API 36).
  • Configuration files: pass-services.json and google-services.json, obtained either from the demo project repository or by requesting them through the OP Tool.
  • Keystore: required for app signing. Obtain it via the OP Tool.
  • Development environment: Android Studio with the necessary SDK tools.
  • VNGGames SDK 套件: 取得最新的 VNGGames SDK zip 檔案。
  • 支援的平台: Android(API 23+)。
  • 最低 Java 支援: Java 17+。
  • Gradle: Android Gradle Plugin 8.5.1+(Target API 36)。
  • 設定檔: pass-services.json 與 google-services.json,可從 demo 專案儲存庫取得,或透過 OP Tool 申請。
  • Keystore: App 簽署所需。透過 OP Tool 取得。
  • 開發環境: 安裝了必要 SDK 工具的 Android Studio。
  • VNGGames SDK 包: 获取最新的 VNGGames SDK zip 文件。
  • 支持的平台: Android(API 23+)。
  • 最低 Java 支持: Java 17+。
  • Gradle: Android Gradle Plugin 8.5.1+(Target API 36)。
  • 配置文件: pass-services.json 与 google-services.json,可从 demo 项目仓库获取,或通过 OP Tool 申请。
  • Keystore: App 签名所需。通过 OP Tool 获取。
  • 开发环境: 安装了必要 SDK 工具的 Android Studio。

Dependencies

Every third-party library the SDK brings into your build. The vgsdk-service plugin adds them from your pass-services.json, so your build gets only the modules your game enabled. Drop your own declaration for anything listed here, or align yours to this version.

SDK 帶進你建置中的所有第三方函式庫。vgsdk-service 外掛會依你的 pass-services.json 加入它們,因此你的建置只會取得你的遊戲已啟用的模組。請移除你自己對此處列出項目的宣告,或將你的版本對齊此版本。

SDK 带进你构建中的所有第三方库。vgsdk-service 插件会依你的 pass-services.json 加入它们,因此你的构建只会取得你的游戏已启用的模块。请移除你自己对此处列出项目的声明,或将你的版本对齐此版本。

LibraryVersionGroup
com.squareup.retrofit2:retrofit2.9.0Core
androidx.security:security-crypto1.0.0Core
com.squareup.retrofit2:converter-gson2.9.0Core
com.github.bumptech.glide:glide5.0.5Core
androidx.browser:browser1.8.0Core
com.squareup.okhttp3:okhttp4.10.0Core
com.squareup.okhttp3:logging-interceptor4.10.0Core
androidx.multidex:multidex2.0.0Core
androidx.recyclerview:recyclerview1.0.0Core
androidx.appcompat:appcompat1.2.0Core
androidx.constraintlayout:constraintlayout1.1.3Core
com.google.code.gson:gson2.13.2Core
com.google.guava:guava27.0.1-androidCore
androidx.lifecycle:lifecycle-extensions2.0.0Core
androidx.lifecycle:lifecycle-compiler2.0.0Core
com.google.android.material:material1.3.0Core
androidx.databinding:viewbinding7.1.2Core
androidx.core:core-ktx1.9.0Core
androidx.activity:activity-ktx1.3.0Core
androidx.fragment:fragment-ktx1.3.0Core
org.jetbrains.kotlinx:kotlinx-coroutines-android1.5.2Core
org.jetbrains.kotlinx:kotlinx-coroutines-core1.5.2Core
org.jetbrains.kotlin:kotlin-reflect1.3.41Core
androidx.lifecycle:lifecycle-process2.4.0Core
androidx.work:work-runtime2.10.2Core
androidx.work:work-runtime-ktx2.8.1Core
io.grpc:grpc-okhttp1.32.2Core
com.google.dagger:dagger2.22.1Core
com.google.dagger:dagger-compiler2.22.1Core
com.google.firebase:firebase-crashlytics20.0.5Core
com.google.android.play:review2.0.0Core
com.google.android.play:review-ktx2.0.0Core
com.google.firebase:firebase-config23.0.1Core
com.google.android.gms:play-services-gcm17.0.0Core
androidx.datastore:datastore1.0.0Core
com.google.crypto.tink:tink-android1.13.0Core
androidx.room:room-ktx2.7.2Core
androidx.room:room-runtime2.7.2Core
androidx.room:room-compiler2.7.2Core
io.github.centrifugal:centrifuge-java0.5.0Core
androidx.viewpager2:viewpager21.1.0Core
com.facebook.android:facebook-android-sdk18.1.3Login channels
com.google.android.gms:play-services-auth20.4.0Login channels
com.android.billingclient:billing8.3.0In-App Purchase
com.appsflyer:af-android-sdk6.18.0Analytics
com.android.installreferrer:installreferrer1.0Analytics
com.google.firebase:firebase-analytics23.0.0Analytics
cn.thinkingdata.android:ThinkingAnalyticsSDK3.4.0Analytics
cn.thinkingdata.android:TDCore1.4.2Analytics
com.facebook.android:facebook-android-sdk18.1.3Social
com.unity3d.ads-mediation:mediation-sdk8.9.1In-App Ads
com.unity3d.ads-mediation:adquality-sdk7.25.1In-App Ads
com.facebook.android:audience-network-sdk6.20.0In-App Ads
com.google.firebase:firebase-messaging25.0.1Engage
com.google.firebase:firebase-inappmessaging-display22.0.3Engage
com.clevertap.android:clevertap-android-sdk7.8.0Engage
com.clevertap.android:push-templates2.1.0Engage
函式庫版本分組
com.squareup.retrofit2:retrofit2.9.0核心
androidx.security:security-crypto1.0.0核心
com.squareup.retrofit2:converter-gson2.9.0核心
com.github.bumptech.glide:glide5.0.5核心
androidx.browser:browser1.8.0核心
com.squareup.okhttp3:okhttp4.10.0核心
com.squareup.okhttp3:logging-interceptor4.10.0核心
androidx.multidex:multidex2.0.0核心
androidx.recyclerview:recyclerview1.0.0核心
androidx.appcompat:appcompat1.2.0核心
androidx.constraintlayout:constraintlayout1.1.3核心
com.google.code.gson:gson2.13.2核心
com.google.guava:guava27.0.1-android核心
androidx.lifecycle:lifecycle-extensions2.0.0核心
androidx.lifecycle:lifecycle-compiler2.0.0核心
com.google.android.material:material1.3.0核心
androidx.databinding:viewbinding7.1.2核心
androidx.core:core-ktx1.9.0核心
androidx.activity:activity-ktx1.3.0核心
androidx.fragment:fragment-ktx1.3.0核心
org.jetbrains.kotlinx:kotlinx-coroutines-android1.5.2核心
org.jetbrains.kotlinx:kotlinx-coroutines-core1.5.2核心
org.jetbrains.kotlin:kotlin-reflect1.3.41核心
androidx.lifecycle:lifecycle-process2.4.0核心
androidx.work:work-runtime2.10.2核心
androidx.work:work-runtime-ktx2.8.1核心
io.grpc:grpc-okhttp1.32.2核心
com.google.dagger:dagger2.22.1核心
com.google.dagger:dagger-compiler2.22.1核心
com.google.firebase:firebase-crashlytics20.0.5核心
com.google.android.play:review2.0.0核心
com.google.android.play:review-ktx2.0.0核心
com.google.firebase:firebase-config23.0.1核心
com.google.android.gms:play-services-gcm17.0.0核心
androidx.datastore:datastore1.0.0核心
com.google.crypto.tink:tink-android1.13.0核心
androidx.room:room-ktx2.7.2核心
androidx.room:room-runtime2.7.2核心
androidx.room:room-compiler2.7.2核心
io.github.centrifugal:centrifuge-java0.5.0核心
androidx.viewpager2:viewpager21.1.0核心
com.facebook.android:facebook-android-sdk18.1.3登入管道
com.google.android.gms:play-services-auth20.4.0登入管道
com.android.billingclient:billing8.3.0應用程式內購買
com.appsflyer:af-android-sdk6.18.0分析
com.android.installreferrer:installreferrer1.0分析
com.google.firebase:firebase-analytics23.0.0分析
cn.thinkingdata.android:ThinkingAnalyticsSDK3.4.0分析
cn.thinkingdata.android:TDCore1.4.2分析
com.facebook.android:facebook-android-sdk18.1.3社群
com.unity3d.ads-mediation:mediation-sdk8.9.1應用程式內廣告
com.unity3d.ads-mediation:adquality-sdk7.25.1應用程式內廣告
com.facebook.android:audience-network-sdk6.20.0應用程式內廣告
com.google.firebase:firebase-messaging25.0.1Engage
com.google.firebase:firebase-inappmessaging-display22.0.3Engage
com.clevertap.android:clevertap-android-sdk7.8.0Engage
com.clevertap.android:push-templates2.1.0Engage
库版本分组
com.squareup.retrofit2:retrofit2.9.0核心
androidx.security:security-crypto1.0.0核心
com.squareup.retrofit2:converter-gson2.9.0核心
com.github.bumptech.glide:glide5.0.5核心
androidx.browser:browser1.8.0核心
com.squareup.okhttp3:okhttp4.10.0核心
com.squareup.okhttp3:logging-interceptor4.10.0核心
androidx.multidex:multidex2.0.0核心
androidx.recyclerview:recyclerview1.0.0核心
androidx.appcompat:appcompat1.2.0核心
androidx.constraintlayout:constraintlayout1.1.3核心
com.google.code.gson:gson2.13.2核心
com.google.guava:guava27.0.1-android核心
androidx.lifecycle:lifecycle-extensions2.0.0核心
androidx.lifecycle:lifecycle-compiler2.0.0核心
com.google.android.material:material1.3.0核心
androidx.databinding:viewbinding7.1.2核心
androidx.core:core-ktx1.9.0核心
androidx.activity:activity-ktx1.3.0核心
androidx.fragment:fragment-ktx1.3.0核心
org.jetbrains.kotlinx:kotlinx-coroutines-android1.5.2核心
org.jetbrains.kotlinx:kotlinx-coroutines-core1.5.2核心
org.jetbrains.kotlin:kotlin-reflect1.3.41核心
androidx.lifecycle:lifecycle-process2.4.0核心
androidx.work:work-runtime2.10.2核心
androidx.work:work-runtime-ktx2.8.1核心
io.grpc:grpc-okhttp1.32.2核心
com.google.dagger:dagger2.22.1核心
com.google.dagger:dagger-compiler2.22.1核心
com.google.firebase:firebase-crashlytics20.0.5核心
com.google.android.play:review2.0.0核心
com.google.android.play:review-ktx2.0.0核心
com.google.firebase:firebase-config23.0.1核心
com.google.android.gms:play-services-gcm17.0.0核心
androidx.datastore:datastore1.0.0核心
com.google.crypto.tink:tink-android1.13.0核心
androidx.room:room-ktx2.7.2核心
androidx.room:room-runtime2.7.2核心
androidx.room:room-compiler2.7.2核心
io.github.centrifugal:centrifuge-java0.5.0核心
androidx.viewpager2:viewpager21.1.0核心
com.facebook.android:facebook-android-sdk18.1.3登录渠道
com.google.android.gms:play-services-auth20.4.0登录渠道
com.android.billingclient:billing8.3.0应用内购买
com.appsflyer:af-android-sdk6.18.0分析
com.android.installreferrer:installreferrer1.0分析
com.google.firebase:firebase-analytics23.0.0分析
cn.thinkingdata.android:ThinkingAnalyticsSDK3.4.0分析
cn.thinkingdata.android:TDCore1.4.2分析
com.facebook.android:facebook-android-sdk18.1.3社交
com.unity3d.ads-mediation:mediation-sdk8.9.1应用内广告
com.unity3d.ads-mediation:adquality-sdk7.25.1应用内广告
com.facebook.android:audience-network-sdk6.20.0应用内广告
com.google.firebase:firebase-messaging25.0.1Engage
com.google.firebase:firebase-inappmessaging-display22.0.3Engage
com.clevertap.android:clevertap-android-sdk7.8.0Engage
com.clevertap.android:push-templates2.1.0Engage

Installation

Add configuration files

  • Extract the VNGGames SDK zip file.
  • From [Demo Project]/[app module]/, copy pass-services.json to [Game Project]/[app module]/.
  • From [Demo Project]/app/, copy google-services.json to the app-level module root directory.
  • Ensure these files are placed in the correct directory and do not modify them.
  • 解壓 VNGGames SDK zip 檔案。
  • 從 [Demo Project]/[app module]/ 將 pass-services.json 複製到 [Game Project]/[app module]/。
  • 從 [Demo Project]/app/ 將 google-services.json 複製到 app 層級模組的根目錄。
  • 確保這些檔案放在正確的目錄中,且不要修改它們。
  • 解压 VNGGames SDK zip 文件。
  • 从 [Demo Project]/[app module]/ 将 pass-services.json 复制到 [Game Project]/[app module]/。
  • 从 [Demo Project]/app/ 将 google-services.json 复制到 app 层级模块的根目录。
  • 确保这些文件放在正确的目录中,且不要修改它们。

Update build.gradle

  • In the project-level build.gradle ([Game Project]/build.gradle), add:
  • 在專案層級的 build.gradle([Game Project]/build.gradle)中加入:
  • 在项目层级的 build.gradle([Game Project]/build.gradle)中添加:
buildscript {
    repositories {
        google()
        jcenter()
        maven { url = 'https://nexus-repo.sdk.vnggames.net/repository/maven-public/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.5.1'
        classpath 'com.google.gms:google-services:4.3.15'
        classpath 'vnggames:vgsdk-service:+'
    }
}
  • In the app-level build.gradle ([Game Project]/[app module]/build.gradle), add:
  • 在 app 層級的 build.gradle([Game Project]/[app module]/build.gradle)中加入:
  • 在 app 层级的 build.gradle([Game Project]/[app module]/build.gradle)中添加:
apply plugin: 'com.android.application'
apply plugin: 'vnggames.vgsdk-service'
android {
    compileSdk 36
    defaultConfig {
        targetSdkVersion 36
    }
}
apply plugin: 'com.google.gms.google-services'
  • Sync the project with Gradle (click Sync Now in Android Studio).

  • Clean and rebuild the project: Build → Clean Project, then Build → Rebuild Project.

  • 使用 Gradle 同步專案(在 Android Studio 中點擊 Sync Now)。

  • 清理並重新建置專案:Build → Clean Project,然後 Build → Rebuild Project。

  • 使用 Gradle 同步项目(在 Android Studio 中点击 Sync Now)。

  • 清理并重新构建项目:Build → Clean Project,然后 Build → Rebuild Project。

Set up the keystore file

  • Copy the keystore files from [Demo Project]/keystore to [Game Project]/keystore.

  • In the app-level build.gradle, add the signing configuration:

  • 將 keystore 檔案從 [Demo Project]/keystore 複製到 [Game Project]/keystore。

  • 在 app 層級的 build.gradle 中加入簽署設定:

  • 将 keystore 文件从 [Demo Project]/keystore 复制到 [Game Project]/keystore。

  • 在 app 层级的 build.gradle 中添加签名配置:

android {
    signingConfigs {
        release {
            storeFile file("../keystore/tronghv.keystore")
            storePassword 'storePassword_goes_here'
            keyAlias 'tronghv'
            keyPassword 'keyPassword_goes_here'
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}

Obtain the password through the OP Tool or by contacting the Store team.

透過 OP Tool 取得密碼,或聯絡 Store 團隊。

通过 OP Tool 获取密码,或联系 Store 团队。

  • Sync your project to apply the changes.
  • 同步你的專案以套用變更。
  • 同步你的项目以应用更改。

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.

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

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

PASS.showLogin(new LoginListener() {
    @Override
    public void onSuccess(UserInfo userInfo) {
        // Signed in: userInfo.userId, userInfo.displayName, userInfo.sessionId
    }
 
    @Override
    public void onFail(Error error) {
        // Handle cancel/failure
    }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Auto login

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

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

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

PASS.autoLogin(new LoginListener() {
    @Override
    public void onSuccess(UserInfo userInfo) {
        // Same result as showLogin
    }
 
    @Override
    public void onFail(Error error) { }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Direct login to a channel

Signs in to one channel directly, bypassing the picker.

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

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

PASS.directLogin(SocialType.GOOGLE, new LoginListener() {
    @Override
    public void onSuccess(UserInfo userInfo) { /* signed in */ }
 
    @Override
    public void onFail(Error error) { /* handle failure */ }
});

Input

輸入

输入

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

Output

輸出

输出

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

Recover a Guest account

Opens the Guest account recovery screen through the Direct login call, so a player can bring a Guest account back onto this device.

透過 Direct login 呼叫開啟訪客帳號尋回畫面,讓玩家可以把訪客帳號重新取回這台裝置。

通过 Direct login 调用打开访客账号寻回界面,让玩家可以把访客账号重新取回这台设备。

Legacy login platform only. On the VGA login platform the call raises a fatal error carrying This feature is available only in Legacy.

僅在 Legacy 登入平台上提供。在 VGA 登入平台上,這次呼叫會引發帶有 This feature is available only in Legacy. 的致命錯誤。

仅在 Legacy 登录平台上提供。在 VGA 登录平台上,这次调用会引发带有 This feature is available only in Legacy. 的致命错误。

PASS.directLogin(SocialType.RECOVERY_ACCOUNT, new LoginListener() {
    @Override
    public void onSuccess(UserInfo userInfo) { /* recovered, reported on the Guest channel */ }
 
    @Override
    public void onFail(Error error) { /* cancel or failure */ }
});

Input

輸入

输入

FieldTypeDescription
socialTypeSocialTypeAlways SocialType.RECOVERY_ACCOUNT. The channel is an input only: a recovered player is reported on the Guest channel, so the session the callback returns never carries it.
欄位型別說明
socialTypeSocialType固定為 SocialType.RECOVERY_ACCOUNT。這個頻道僅作為輸入值: 尋回成功的玩家會以 Guest 頻道回報,因此回呼傳回的工作階段永遠不會帶有它。
字段类型描述
socialTypeSocialType固定为 SocialType.RECOVERY_ACCOUNT。这个渠道仅作为输入值: 寻回成功的玩家会以 Guest 渠道报告,因此回调返回的会话永远不会带有它。

Output

輸出

输出

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

Log out

Signs the current player out and clears the stored session.

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

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

PASS.logout();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Quick Authentication

Zero-interaction sign-in and VGA account management: available only with VGA login. v1 (PassSDK.shared) is the first-generation API: quick login resolves on the login callback. v2 (VGSDKQuickAuth) is the listener-based facade: the listener’s onSuccess delivers the player’s info, onError the failure reason. Manage account opens the VGA account-management screen and applies to accounts signed in with either version.

零互動登入與 VGA 帳號管理: 僅在使用 VGA 登入時可用。v1(PassSDK.shared)為第一代 API:快速登入透過登入回呼回傳結果。v2(VGSDKQuickAuth)為以監聽器為基礎的門面:監聽器的 onSuccess 會傳回玩家資訊,onError 則傳回失敗原因。管理帳號 會開啟 VGA 帳號管理畫面,且適用於以任一版本登入的帳號。

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

v1

Quick login

Signs the player in with no form to load and no required interaction.

讓玩家登入,無需載入表單,也不需要任何互動。

无需加载表单、无需任何交互即可让玩家登录。

PASS.quickLogin(new LoginListener() {
    @Override
    public void onSuccess(UserInfo userInfo) { /* signed in */ }
 
    @Override
    public void onFail(Error error) { /* error on failure */ }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

v2

Sign in

Presents the quick-authentication sign-in UI so the player signs in with an available account.

顯示快速身分驗證登入介面,讓玩家使用可用的帳號登入。

展示快速身份验证登录界面,让玩家使用可用账号登录。

VGSDKQuickAuth.showLogin(new VGSDKAuthenticationListener() {
    @Override
    public void onSuccess(UserInfo userInfo) { /* signed in */ }
 
    @Override
    public void onFail(Error error) { /* failed */ }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Play as guest

Signs the player in as an anonymous guest: no account selection or credentials required.

以匿名訪客身分讓玩家登入: 無需選擇帳號或提供憑證。

以匿名访客身份让玩家登录: 无需选择账号或提供凭据。

VGSDKQuickAuth.playAsGuest(new VGSDKAuthenticationListener() {
    @Override
    public void onSuccess(UserInfo userInfo) { /* signed in as guest */ }
 
    @Override
    public void onFail(Error error) { /* failed */ }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Show channel selection

Presents the channel picker so the player chooses which sign-in channel to use.

顯示頻道選擇器,讓玩家選擇要使用的登入頻道。

展示渠道选择器,让玩家选择要使用的登录渠道。

VGSDKQuickAuth.showChannelSelection(new VGSDKAuthenticationListener() {
    @Override
    public void onSuccess(UserInfo userInfo) { /* signed in */ }
 
    @Override
    public void onFail(Error error) { /* failed */ }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Manage account

Open account management

Opens the VGA account-management screen and reports what the player did. Works for accounts signed in with either quick-auth version.

開啟 VGA 帳號管理畫面,並回報玩家執行的操作。

打开 VGA 账号管理界面并报告玩家所执行的操作。

PASS.manageAccount(new ManageAccountListener() {
    @Override
    public void onBoundAccountSuccess(UserInfo userInfo) { /* bound */ }
 
    @Override
    public void onSwitchAccountSuccess(UserInfo userInfo) { /* switched */ }
 
    @Override
    public void onClose() { /* closed without change */ }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
onBoundAccountSuccessUserInfoThe signed-in player. Fields: UserInfo.
onSwitchAccountSuccessUserInfoThe signed-in player. Fields: UserInfo.
onClose:Closed the screen without acting.
欄位型別說明
onBoundAccountSuccessUserInfo已登入的玩家。欄位詳見 UserInfo。
onSwitchAccountSuccessUserInfo已登入的玩家。欄位詳見 UserInfo。
onClose:未執行任何操作即關閉畫面。
字段类型描述
onBoundAccountSuccessUserInfo已登录的玩家。字段详见 UserInfo。
onSwitchAccountSuccessUserInfo已登录的玩家。字段详见 UserInfo。
onClose:未执行任何操作即关闭屏幕。

Session validation

Validate a signed-in player from your own backend. Every login path in this guide, the channel picker, auto login, direct login and quick login alike, ends with a userID and a sessionID in the game client. Neither proves anything on its own: a client can claim any session. This is the server-to-server check that settles it, so it has no SDK call and no client-side equivalent.

從你自己的後端驗證已登入的玩家。本指南中的每一種登入路徑,無論是頻道選單、Auto login、Direct login 或 Quick login,最後都會在遊戲用戶端留下一組 userID 與 sessionID。這兩個值本身都不能證明任何事:用戶端可以宣稱任何工作階段。這就是用來確認的伺服器對伺服器檢查,因此它沒有 SDK 呼叫,用戶端也沒有等價做法。

从你自己的后端验证已登录的玩家。本指南中的每一种登录路径,无论是渠道选单、Auto login、Direct login 或 Quick login,最后都会在游戏客户端留下一组 userID 与 sessionID。这两个值本身都不能证明任何事:客户端可以声称任何会话。这就是用来确认的服务器对服务器检查,因此它没有 SDK 调用,客户端也没有等价做法。

Check the login session (server-side only)

Validates a player’s session from YOUR game server, not from the client. After ANY login callback hands the game a userID and a sessionID, quick login included, 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 host to send it to and your game’s secret key are issued together on request, see below.

從你的遊戲伺服器驗證玩家的工作階段,而不是從用戶端。任何一種登入回呼把 userID 與 sessionID 交給遊戲之後(含 Quick login),遊戲的後端以 application/x-www-form-urlencoded 將兩者 POST 到 /api/login/checkSession,只有在 returnCode 為 1 時才信任該玩家。SDK 沒有對應的呼叫,用戶端也沒有等價做法:用戶端可以宣稱任何工作階段,這正是需要這道檢查的原因。這個路徑在所有登入後端都相同,不同的是主機與 sig 的欄位順序:VGA 只有一個主機,Passport 舊版則依地區各有一個,分為 VN 與 SEA。你這個版本要用的主機會與你的遊戲 secret key 一併另行申請,見下方說明。

从你的游戏服务器验证玩家的会话,而不是从客户端。任何一种登录回调把 userID 与 sessionID 交给游戏之后(含 Quick login),游戏的后端以 application/x-www-form-urlencoded 将两者 POST 到 /api/login/checkSession,只有在 returnCode 为 1 时才信任该玩家。SDK 没有对应的调用,客户端也没有等价做法:客户端可以声称任何会话,这正是需要这道检查的原因。这个路径在所有登录后端都相同,不同的是主机与 sig 的字段顺序:VGA 只有一个主机,Passport 旧版则依地区各有一个,分为 VN 与 SEA。你这个版本要用的主机会与你的游戏 secret key 一并另行申请,见下方说明。

# Host and secret key come from your server's environment, never from a literal.
TIMESTAMP=$(date +%s)
SIG=$(printf '%s%s%s%s%s' "$SECRET_KEY" "$GAME_ID" "$USER_ID" "$TIMESTAMP" "$SESSION_ID" | md5sum | cut -d' ' -f1)
 
curl -X POST "$HOST/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 HOST 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.
sigstringMD5 of your secret key followed by gameID, userID, timestamp and sessionID, concatenated in that order with no separator between them: 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把你的 secret key 接上 gameID、userID、timestamp、sessionID,依這個順序直接串接、中間不加任何分隔符,再取 MD5:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 團隊發給你的團隊,且只存在於伺服器端,這正是這個呼叫不能放在用戶端的原因。
字段类型描述
userIDstringVNGGames 唯一用户 ID。
sessionIDstring用于验证后端调用的会话令牌。
gameIDstringSDK 会读取的 VNGGames Account 凭据。
timestampstring发出调用当下的 Unix 时间,单位为「秒」。
sigstring把你的 secret key 接上 gameID、userID、timestamp、sessionID,依这个顺序直接拼接、中间不加任何分隔符,再取 MD5: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。

Check the login session (server-side only)

Validates a player’s session from YOUR game server, not from the client. After ANY login callback hands the game a userID and a sessionID, quick login included, 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. This build has TWO hosts, one for VN and one for SEA, and you are issued the one your game runs on. The path, the parameters and the signature are the same on both. That host and your game’s secret key are issued together on request, see below.

從你的遊戲伺服器驗證玩家的工作階段,而不是從用戶端。任何一種登入回呼把 userID 與 sessionID 交給遊戲之後(含 Quick login),遊戲的後端以 application/x-www-form-urlencoded 將兩者 POST 到 /api/login/checkSession,只有在 returnCode 為 1 時才信任該玩家。SDK 沒有對應的呼叫,用戶端也沒有等價做法:用戶端可以宣稱任何工作階段,這正是需要這道檢查的原因。這個版本有兩個主機,一個給 VN、一個給 SEA,你會拿到你的遊戲實際執行的那一個。兩者的路徑、參數與簽章方式完全相同。該主機與你的遊戲 secret key 會一併另行申請,見下方說明。

从你的游戏服务器验证玩家的会话,而不是从客户端。任何一种登录回调把 userID 与 sessionID 交给游戏之后(含 Quick login),游戏的后端以 application/x-www-form-urlencoded 将两者 POST 到 /api/login/checkSession,只有在 returnCode 为 1 时才信任该玩家。SDK 没有对应的调用,客户端也没有等价做法:客户端可以声称任何会话,这正是需要这道检查的原因。这个版本有两个主机,一个给 VN、一个给 SEA,你会拿到你的游戏实际运行的那一个。两者的路径、参数与签名方式完全相同。该主机与你的游戏 secret key 会一并另行申请,见下方说明。

# Host and secret key come from your server's environment, never from a literal.
# $HOST is your VN or SEA host, whichever your game was issued.
TIMESTAMP=$(date +%s)
SIG=$(printf '%s%s%s%s%s' "$SECRET_KEY" "$GAME_ID" "$USER_ID" "$SESSION_ID" "$TIMESTAMP" | md5sum | cut -d' ' -f1)
 
curl -X POST "$HOST/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 HOST 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 都會在你整合時收到的 SDK_Define_Variable.pdf 裡,不會公開在這裡。VN 與 SEA 後端是不同的主機,所以該檔案裡的那一個就是你遊戲要用的。若你手上沒有這份檔案,請來信 pin.sdk.dev@vng.com.vn。secret key 絕對不可以隨遊戲用戶端一起發布。

仅限服务器端。 路径为 /api/login/checkSession,而主机与 secret key 都会在你集成时收到的 SDK_Define_Variable.pdf 里,不会公开在这里。VN 与 SEA 后端是不同的主机,所以该文件里的那一个就是你游戏要用的。若你手上没有这份文件,请来信 pin.sdk.dev@vng.com.vn。secret key 绝对不可以随游戏客户端一起发布。

Input

輸入

输入

FieldTypeDescription
userIDstringUnique VNGGames user id.
sessionIDstringSession token used to authenticate backend calls.
gameIDstringYour game’s ID, the same one your SDK integration is configured with.
timestampstringUnix time in SECONDS at the moment of the call.
sigstringMD5 of your secret key followed by gameID, userID, sessionID and timestamp, concatenated in that order with no separator between them: md5(secretKey + gameID + userID + sessionID + timestamp). 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用於驗證後端呼叫的工作階段權杖。
gameIDstring你的遊戲 ID,與你的 SDK 整合所設定的是同一個。
timestampstring發出呼叫當下的 Unix 時間,單位為「秒」。
sigstring把你的 secret key 接上 gameID、userID、sessionID、timestamp,依這個順序直接串接、中間不加任何分隔符,再取 MD5:md5(secretKey + gameID + userID + sessionID + timestamp)。secret key 由 SDK 團隊發給你的團隊,且只存在於伺服器端,這正是這個呼叫不能放在用戶端的原因。
字段类型描述
userIDstringVNGGames 唯一用户 ID。
sessionIDstring用于验证后端调用的会话令牌。
gameIDstring你的游戏 ID,与你的 SDK 集成所配置的是同一个。
timestampstring发出调用当下的 Unix 时间,单位为「秒」。
sigstring把你的 secret key 接上 gameID、userID、sessionID、timestamp,依这个顺序直接拼接、中间不加任何分隔符,再取 MD5:md5(secretKey + gameID + userID + sessionID + timestamp)。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。

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 执行购买。商品与购买状态在监听器闭包上返回。

Traditional

Get products

Fetches the sellable products for a set of item ids.

為一組道具 ID 取得可販售的商品。

为一组物品 id 获取可售商品。

PASS.getProductList(Arrays.asList("item-1"), new ProductListListener() {
    @Override
    public void onFinished(List<SkuDetails> products) {
        // Render pricing, e.g. products.get(0).getPrice() (store-formatted)
    }
});

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
productsList<SkuDetails>The products found. Empty when no id matched. Each entry: SkuDetails.
欄位型別說明
productsList<SkuDetails>找到的商品。沒有 id 相符時為空。每個項目:SkuDetails。
字段类型描述
productsList<SkuDetails>找到的商品。没有 id 匹配时为空。每个条目:SkuDetails。

Purchase

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

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

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

PaymentInfo info = new PaymentInfo();
info.setUserID("user-1");
info.setItemID("item-1");
info.setServerID("server-1");
info.setRoleID("role-1");
info.setAppTransID("txn-1");
info.setAddInfo("");
PASS.pay(info, new PaymentListener() {
    @Override public void onSuccess() { /* granted */ }
    @Override public void onProcessing() { /* awaiting external confirmation */ }
    @Override public void onCancel() { /* player canceled */ }
    @Override public void onFail(String message) { /* failed */ }
});

Input

輸入

输入

FieldTypeDescription
paymentInfoPaymentInfoThe purchase request: full model: PaymentInfo. Optional clientKey / secretKey set signing keys.
欄位型別說明
paymentInfoPaymentInfo購買請求: 完整模型:PaymentInfo。選填的 clientKey / secretKey 用於設定簽章金鑰。
字段类型描述
paymentInfoPaymentInfo购买请求: 完整模型:PaymentInfo。可选的 clientKey / secretKey 用于设置签名密钥。

Output

輸出

输出

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

Check item reward

Reports whether the player has a reward waiting to be granted, so the game can show or hide the claim entry point.

回報玩家是否有待發放的獎勵,讓遊戲決定要顯示或隱藏領取入口。

报告玩家是否有待发放的奖励,让游戏决定要显示或隐藏领取入口。

PASS.checkItemReward(new CheckHasRewardListener() {
    @Override
    public void onSuccess(boolean isHas) {
        // true: a reward is pending, show the claim entry point
    }
 
    @Override
    public void onError(String s) {
        // The check could not complete: keep the entry point hidden
    }
});

Input

輸入

输入

FieldTypeDescription
listenerCheckHasRewardListenerResult listener for the check.
欄位型別說明
listenerCheckHasRewardListener此次檢查的結果監聽器。
字段类型描述
listenerCheckHasRewardListener本次检查的结果监听器。

Output

輸出

输出

FieldTypeDescription
onSuccess(Boolean) -> UnitCalled with true when a reward is pending, false when there is none.
onError(String?) -> UnitThe check could not complete, with the reason. No dedicated error code is raised on this path.
欄位型別說明
onSuccess(Boolean) -> Unit有待發放的獎勵時以 true 呼叫,沒有時則為 false。
onError(String?) -> Unit檢查無法完成,並附上原因。此路徑不會產生專屬的錯誤碼。
字段类型描述
onSuccess(Boolean) -> Unit有待发放的奖励时以 true 调用,没有时则为 false。
onError(String?) -> Unit检查无法完成,并附上原因。此路径不会产生专属的错误码。

Verify reward

Grants the pending reward and reports whether a failure is worth retrying.

發放待領取的獎勵,並回報該次失敗是否值得重試。

发放待领取的奖励,并报告该次失败是否值得重试。

RewardInfo rewardInfo = new RewardInfo();
rewardInfo.setUserID("user-1");
rewardInfo.setServerID("server-1");
rewardInfo.setAppTransID("txn-1");
rewardInfo.setAddInfo("");
rewardInfo.setRoleID("role-1");
PASS.verifyReward(rewardInfo, new VerifyRewardListener() {
    @Override public void onFinishSuccess(String message) { /* reward granted */ }
    @Override public void onFinishFailToRetry(String message) { /* transient: retrying is safe */ }
    @Override public void onFinishFailNonRetry(String message) { /* permanent, e.g. 9011: do not retry */ }
});

Input

輸入

输入

FieldTypeDescription
rewardInfoRewardInfoThe reward claim. All five fields are required.
rewardInfo.userIDString?Buyer’s VNGGames user id.
rewardInfo.serverIDStringGame server id.
rewardInfo.roleIDStringCharacter/role id.
rewardInfo.appTransIDStringYour app-side transaction id, for reconciliation.
rewardInfo.addInfoStringExtra passthrough data. Empty string when unused.
listenerVerifyRewardListenerResult listener for the grant.
欄位型別說明
rewardInfoRewardInfo獎勵領取請求。五個欄位皆為必填。
rewardInfo.userIDString?購買者的 VNGGames 使用者 ID。
rewardInfo.serverIDString伺服器 ID。
rewardInfo.roleIDString角色 ID。
rewardInfo.appTransIDString你的應用程式端交易 ID,用於對帳。
rewardInfo.addInfoString額外的傳遞資料。未使用時請傳入空字串。
listenerVerifyRewardListener此次發放的結果監聽器。
字段类型描述
rewardInfoRewardInfo奖励领取请求。五个字段均为必填。
rewardInfo.userIDString?购买者的 VNGGames 用户 ID。
rewardInfo.serverIDString服务器 ID。
rewardInfo.roleIDString角色 ID。
rewardInfo.appTransIDString你的应用端交易 ID,用于对账。
rewardInfo.addInfoString额外的透传数据。未使用时请传入空字符串。
listenerVerifyRewardListener本次发放的结果监听器。

Output

輸出

输出

FieldTypeDescription
onFinishSuccess(String?) -> UnitThe reward was granted.
onFinishFailToRetry(String?) -> UnitThe grant failed transiently. Retrying the same request is safe.
onFinishFailNonRetry(String?) -> UnitThe grant failed permanently, for example the receipt was already used or no reward package exists (9011). Do not retry the same request.
欄位型別說明
onFinishSuccess(String?) -> Unit獎勵已發放。
onFinishFailToRetry(String?) -> Unit發放因暫時性問題失敗。以相同請求重試是安全的。
onFinishFailNonRetry(String?) -> Unit發放永久失敗,例如收據已被使用,或查無獎勵包(9011)。請勿以相同請求重試。
字段类型描述
onFinishSuccess(String?) -> Unit奖励已发放。
onFinishFailToRetry(String?) -> Unit发放因临时性问题失败。以相同请求重试是安全的。
onFinishFailNonRetry(String?) -> Unit发放永久失败,例如收据已被使用,或查无奖励包(9011)。请勿以相同请求重试。

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.

分析的必要設定。

分析的必需设置。

// Bind role context once after login, before sending events
VGSDKAnalytics.miscConfigAnalytics("role-1", "Hero");

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
roleNameStringCharacter/role name.
欄位型別說明
roleIdString角色 ID。
roleNameString角色名稱。
字段类型描述
roleIdString角色 id。
roleNameString角色名称。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Integration Limitations

Rules & limits

Constraints that apply to every event you send through this facade: they aggregate the rules of the underlying providers. Review them before instrumenting:

  • Event names must begin with a letter, contain no spaces (use underscores), and be at most 100 characters. They may not begin with ", \, =, +, or -, are case-sensitive (af_purchase ≠ af_PURCHASE), and may include non-English characters.
  • Per event: at most 25 parameters.
  • Parameter names must be at most 40 characters.
  • Parameter values must not exceed 1000 characters (longer values may be truncated). Keep total event values under 2000 characters.
  • Revenue / price values use digits and a single decimal point only, with at most 5 digits after the point.
  • Cardinality: at most 300 unique event names per day.
  • Unique users are counted only for the first 100 events after a user installs the app.
  • Referring URLs must be URL-encoded.
  • Meta (Facebook) Ads impose additional limits on event parameters.

適用於你透過此門面傳送的每個事件的限制: 它們彙整了底層各供應商的規則。請在埋點前詳閱:

  • 事件名稱 必須以字母開頭、不得包含空格(請使用底線),且最多 100 個字元。不得以 "、\、=、+ 或 - 開頭,區分大小寫(af_purchase ≠ af_PURCHASE),並可包含非英文字元。
  • 每個事件: 最多 25 個參數。
  • 參數名稱 最多 40 個字元。
  • 參數值 不得超過 1000 個字元(過長的值可能會被截斷)。請將事件的總值控制在 2000 個字元以內。
  • 收益/價格值 僅能使用數字與單一小數點,小數點後最多 5 位數。
  • 基數: 每天最多 300 個不重複的事件名稱。
  • 不重複使用者 僅在使用者安裝應用程式後的前 100 個事件內計算。
  • 來源 URL 必須經過 URL 編碼。
  • Meta(Facebook)Ads 對事件參數施加額外限制。

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

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

Custom event

Send a custom event

Sends one custom event to the providers you explicitly choose via the platforms list. The event name is sent as-is: its natural name: apart from the optional per-provider prefix you set yourself. To send to the SDK’s default provider set without naming platforms, use miscCustomEvent instead.

將一個自訂事件傳送到你透過 platforms 清單明確選擇的供應商。事件名稱會原樣傳送: 使用其自然名稱: 除了你自行設定的可選每供應商前綴之外。若要在不指定平台的情況下傳送到 SDK 的預設供應商集合,請改用 miscCustomEvent。

向你通过 platforms 列表显式选择的提供方发送一个自定义事件。事件名称按原样(其自然名称)发送,仅带上你自行设置的可选的每提供方前缀。若要发送到 SDK 的默认提供方集合而不指定 platforms,请改用 miscCustomEvent。

// Pick the providers to send to; "" = no per-provider prefix
VGSDKAnalyticsPlatform facebook =
    new VGSDKAnalyticsPlatform(VGSDKAnalyticsProvider.facebook, "");
HashMap<String, Object> params = new HashMap<>();
params.put("level", 5);
VGSDKAnalytics.sendCustomEvent("level_up", params, facebook);

Input

輸入

输入

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

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

// Sends to the SDK's default provider set (no platforms list)
HashMap<String, Object> params = new HashMap<>();
params.put("k", "v");
VGSDKAnalytics.miscCustomEvent("my_event", params);

Input

輸入

输入

FieldTypeDescription
eventNameStringEvent name.
parametersHashMap<String, Object>Event parameters.
欄位型別說明
eventNameString事件名稱。
parametersHashMap<String, Object>事件參數。
字段类型描述
eventNameString事件名称。
parametersHashMap<String, Object>事件参数。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Conversion Rate

1. App open

Logs an app open.

記錄一次應用程式開啟。

记录一次应用打开。

VGSDKAnalytics.regAppOpen(new HashMap<>());

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

2. Get configuration

Logs the configuration fetch.

記錄設定的取得。

记录配置获取。

VGSDKAnalytics.regGetConfiguration(new HashMap<>());

Input

輸入

输入

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

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(new HashMap<>());

Input

輸入

输入

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

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(new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
progressStringProgress marker.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
progressString進度標記。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
progressString进度标记。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
progressStringProgress marker.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
progressString進度標記。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
progressString进度标记。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
progressStringProgress marker.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
progressString進度標記。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
progressString进度标记。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
progressStringProgress marker.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
progressString進度標記。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
progressString进度标记。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
progressStringProgress marker.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
progressString進度標記。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
progressString进度标记。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
itemIdStringItem id.
itemNameStringItem name.
itemPriceStringItem price.
itemCurrencyStringCurrency code.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
itemIdString道具 ID。
itemNameString道具名稱。
itemPriceString道具價格。
itemCurrencyString貨幣代碼。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
itemIdString物品 id。
itemNameString物品名称。
itemPriceString物品价格。
itemCurrencyString货币代码。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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 Pack",
    "22000", "VND", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
itemIdStringItem id.
itemNameStringItem name.
itemPriceStringItem price.
itemCurrencyStringCurrency code.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
itemIdString道具 ID。
itemNameString道具名稱。
itemPriceString道具價格。
itemCurrencyString貨幣代碼。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
itemIdString物品 id。
itemNameString物品名称。
itemPriceString物品价格。
itemCurrencyString货币代码。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
currentVipLevelStringNew VIP level.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
currentVipLevelString新的 VIP 等級。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
currentVipLevelString新的 VIP 等级。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", "22000", "VND", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
itemIdStringItem id.
itemNameStringItem name.
itemVipLevelStringVIP level of the item.
itemPriceStringItem price.
itemCurrencyStringCurrency code.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
itemIdString道具 ID。
itemNameString道具名稱。
itemVipLevelString道具的 VIP 等級。
itemPriceString道具價格。
itemCurrencyString貨幣代碼。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
itemIdString物品 id。
itemNameString物品名称。
itemVipLevelString物品的 VIP 等级。
itemPriceString物品价格。
itemCurrencyString货币代码。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", "42", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
currentLevelStringNew level.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
currentLevelString新的等級。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
currentLevelString新的等级。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Agree to terms

Logs acceptance of all terms.

記錄同意所有條款。

记录接受所有条款。

VGSDKAnalytics.nruAgreeAllTerm(new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
mainQuestIdStringMain-quest id.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
mainQuestIdString主線任務 ID。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
mainQuestIdString主线任务 id。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
dailyQuestIdStringDaily-quest id.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
dailyQuestIdString每日任務 ID。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
dailyQuestIdString每日任务 id。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
dailyRewardIdStringDaily-reward id.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
dailyRewardIdString每日獎勵 ID。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
dailyRewardIdString每日奖励 id。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
itemIdStringItem id.
itemNameStringItem name.
itemPriceStringItem price.
itemCurrencyStringCurrency code.
itemQuantityStringItem quantity.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
itemIdString道具 ID。
itemNameString道具名稱。
itemPriceString道具價格。
itemCurrencyString貨幣代碼。
itemQuantityString道具數量。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
itemIdString物品 id。
itemNameString物品名称。
itemPriceString物品价格。
itemCurrencyString货币代码。
itemQuantityString物品数量。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
itemIdStringItem id.
itemNameStringItem name.
itemPriceStringItem price.
itemCurrencyStringCurrency code.
itemQuantityStringItem quantity.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
itemIdString道具 ID。
itemNameString道具名稱。
itemPriceString道具價格。
itemCurrencyString貨幣代碼。
itemQuantityString道具數量。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
itemIdString物品 id。
itemNameString物品名称。
itemPriceString物品价格。
itemCurrencyString货币代码。
itemQuantityString物品数量。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
gachaTypeStringGacha type/banner.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
gachaTypeString轉蛋類型/卡池。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
gachaTypeString抽卡类型 / 卡池。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
guildIdStringGuild id.
guildNameStringGuild name.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
guildIdString公會 ID。
guildNameString公會名稱。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
guildIdString公会 id。
guildNameString公会名称。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
guildIdStringGuild id.
guildNameStringGuild name.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
guildIdString公會 ID。
guildNameString公會名稱。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
guildIdString公会 id。
guildNameString公会名称。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
guildIdStringGuild id.
guildNameStringGuild name.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
guildIdString公會 ID。
guildNameString公會名稱。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
guildIdString公会 id。
guildNameString公会名称。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Other

Splash screen

Logs the splash screen being shown.

記錄啟動畫面被顯示。

记录启动画面的展示。

VGSDKAnalytics.regSplashScreen(new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

FieldTypeDescription
roleIdStringCharacter/role id.
serverIdStringGame server id.
itemIdStringItem id.
itemNameStringItem name.
itemPriceStringItem price.
itemCurrencyStringCurrency code.
extraDataHashMap<String, Object>Additional custom key/values attached to the event.
欄位型別說明
roleIdString角色 ID。
serverIdString遊戲伺服器 ID。
itemIdString道具 ID。
itemNameString道具名稱。
itemPriceString道具價格。
itemCurrencyString貨幣代碼。
extraDataHashMap<String, Object>附加到事件的額外自訂鍵/值。
字段类型描述
roleIdString角色 id。
serverIdString游戏服务器 id。
itemIdString物品 id。
itemNameString物品名称。
itemPriceString物品价格。
itemCurrencyString货币代码。
extraDataHashMap<String, Object>附加到该事件的额外自定义键值对。

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", new HashMap<>());

Input

輸入

输入

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

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", new HashMap<>());

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Ad revenue

Reports ad revenue through the unified analytics facade.

透過統一分析介面回報廣告收益。

通过统一分析接口上报广告收入。

// Reports ad revenue through the unified analytics facade
HashMap<String, String> extraData = new HashMap<>();
VGSDKAnalytics.miscAdRevenue("AdMob", VGSDKAdRevenueMediationNetwork.GoogleAdMob,
    22000.0, "VND", extraData);

Input

輸入

输入

FieldTypeDescription
monetizationNetworkStringMonetization network name.
mediationNetworkVGSDKAdRevenueMediationNetworkMediation network: see Ad revenue mediation network.
revenueDoubleRevenue amount.
currencyCodeStringCurrency code.
extraDataMap<String, String>Additional custom key/values attached to the event.
欄位型別說明
monetizationNetworkString營利聯播網名稱。
mediationNetworkVGSDKAdRevenueMediationNetwork中介聯播網: 請參閱 廣告收益中介聯播網。
revenueDouble收益金額。
currencyCodeString貨幣代碼。
extraDataMap<String, String>附加到事件的額外自訂鍵/值。
字段类型描述
monetizationNetworkString变现网络名称。
mediationNetworkVGSDKAdRevenueMediationNetwork聚合网络: 请参阅 广告收入聚合网络。
revenueDouble收入金额。
currencyCodeString货币代码。
extraDataMap<String, String>附加到该事件的额外自定义键值对。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Customer Support

Open the in-app support center, signed in and pre-filled with the player’s context. Results arrive on the listener’s closures.

開啟應用程式內的支援中心,已登入並預先填入玩家的情境資料。結果會透過監聽器的閉包傳回。

打开应用内客户支持中心,已登录并预填了玩家的上下文。结果在监听器的闭包上返回。

Open support center

Presents the support center for the player.

為玩家顯示支援中心。

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

VGSDKSupportInfo info = new VGSDKSupportInfo("user-1", "server-1", "10",
        "role", "vga", "guild", "Need help");
VGSDKSupport.openSupportCenter(info, new VGSDKSupportCenterListener() {
    @Override public void onAction(Map<String, Object> payload) { }
    @Override public void onClosed() { }
    @Override public void onError(VGSDKError error) { }
});

Input

輸入

输入

FieldTypeDescription
infoVGSDKSupportInfoPlayer context: full model: VGSDKSupportInfo.
欄位型別說明
infoVGSDKSupportInfo玩家情境: 完整模型:VGSDKSupportInfo。
字段类型描述
infoVGSDKSupportInfo玩家上下文: 完整模型:VGSDKSupportInfo。

Output

輸出

输出

FieldTypeDescription
onActionMap<String, Any>An in-portal action the player triggered, with its payload.
onClosed:The support center was dismissed.
onErrorVGSDKErrorAn error occurred: see General error codes.
欄位型別說明
onActionMap<String, Any>玩家在支援中心內觸發的操作,附帶其負載。
onClosed:支援中心已關閉。
onErrorVGSDKError發生錯誤: 請參閱 一般錯誤碼。
字段类型描述
onActionMap<String, Any>玩家在门户内触发的操作及其负载。
onClosed:客户支持中心已关闭。
onErrorVGSDKError发生了错误: 请参阅 通用错误码。

In-App Ads

Monetize with ironSource-mediated rewarded video, or Meta Audience Network interstitial / rewarded formats. Ad events arrive on the listener objects you pass in: there is no status enum.

透過 ironSource 中介的獎勵影片,或 Meta Audience Network 的插頁式/獎勵式格式進行營利。廣告事件會透過你傳入的監聽器物件傳回: 沒有狀態列舉。

通过 ironSource 聚合的激励视频,或 Meta Audience Network 的插屏 / 激励格式进行变现。广告事件在你传入的监听器对象上返回: 没有状态枚举。

ironSource

Initialize ironSource

Initializes ironSource with an init listener and a rewarded-video listener.

以初始化監聽器與獎勵影片監聽器初始化 ironSource。

使用一个初始化监听器和一个激励视频监听器来初始化 ironSource。

PassLevelPlayRewardedVideoListener rvListener = new PassLevelPlayRewardedVideoListener() {
    @Override
    public void adRewarded(Placement placement, AdInfo adInfo) { /* grant reward */ }
 
    @Override
    public void adShowFailed(IronSourceError error, AdInfo adInfo) { /* show failed */ }
};
 
PASS.initIronSource(rvListener, new PassInitIronSourceCallback() {
    @Override
    public void onComplete() { /* ironSource ready */ }
 
    @Override
    public void onFail() { /* init failed */ }
});

Input

輸入

输入

FieldTypeDescription
rewardedVideoListenerPassLevelPlayRewardedVideoListenerRewarded-video ad-event listener (see Show rewarded video). Ad/reward events for later shows arrive here.
initCallbackPassInitIronSourceCallbackInitialization listener: reports init success/failure.
欄位型別說明
rewardedVideoListenerPassLevelPlayRewardedVideoListener獎勵影片廣告事件監聽器(請參閱「顯示獎勵影片」)。後續顯示的廣告/獎勵事件會送達這裡。
initCallbackPassInitIronSourceCallback初始化監聽器: 回報初始化成功/失敗。
字段类型描述
rewardedVideoListenerPassLevelPlayRewardedVideoListener激励视频广告事件监听器(见“展示激励视频”)。后续展示的广告/奖励事件会送达这里。
initCallbackPassInitIronSourceCallback初始化监听器: 报告初始化成功/失败。

Output

輸出

输出

FieldTypeDescription
initCallback.onComplete() -> UnitInitialization finished: ironSource is ready.
initCallback.onFail() -> UnitInitialization failed.
adRewarded(Placement?, AdInfo?) -> UnitReward earned: grant it here.
adAvailable(AdInfo?) -> UnitAn ad is available.
adUnavailable() -> UnitNo ad available.
adOpened(AdInfo?) -> UnitAd opened.
adClicked(Placement?, AdInfo?) -> UnitAd clicked.
adClosed(AdInfo?) -> UnitAd closed.
adShowFailed(IronSourceError?, AdInfo?) -> UnitAd failed to show: carries the underlying ironSource error (its native code, not a VGSDK code).
failed() -> UnitA pre-show check failed: no error payload.
欄位型別說明
initCallback.onComplete() -> Unit初始化完成: ironSource 已就緒。
initCallback.onFail() -> Unit初始化失敗。
adRewarded(Placement?, AdInfo?) -> Unit獲得的獎勵: 在此發放。
adAvailable(AdInfo?) -> Unit有可用的廣告。
adUnavailable() -> Unit沒有可用的廣告。
adOpened(AdInfo?) -> Unit廣告已開啟。
adClicked(Placement?, AdInfo?) -> Unit廣告被點擊。
adClosed(AdInfo?) -> Unit廣告已關閉。
adShowFailed(IronSourceError?, AdInfo?) -> Unit廣告顯示失敗: 帶有底層的 ironSource 錯誤(其原生代碼,非 VGSDK 代碼)。
failed() -> Unit顯示前檢查失敗: 無錯誤負載。
字段类型描述
initCallback.onComplete() -> Unit初始化完成: ironSource 已就绪。
initCallback.onFail() -> Unit初始化失败。
adRewarded(Placement?, AdInfo?) -> Unit获得的奖励: 在此发放。
adAvailable(AdInfo?) -> Unit有可用的广告。
adUnavailable() -> Unit没有可用的广告。
adOpened(AdInfo?) -> Unit广告已打开。
adClicked(Placement?, AdInfo?) -> Unit广告被点击。
adClosed(AdInfo?) -> Unit广告已关闭。
adShowFailed(IronSourceError?, AdInfo?) -> Unit广告展示失败: 携带底层的 ironSource 错误(其原生代码,非 VGSDK 代码)。
failed() -> Unit展示前检查失败: 无错误负载。

Show rewarded video

Shows a rewarded video for a placement. Ad events arrive on the rewarded-video listener.

為某個版位顯示獎勵影片。廣告事件會透過獎勵影片監聽器傳回。

为某个广告位展示激励视频。广告事件在激励视频监听器上返回。

RewardVideo video = new RewardVideo.RewardBuilder()
    .setPlacementName("Main")
    .setTrackNetworkState(true)
    .buildReward();
PASS.showVideoAds(video);
// Ad events (incl. adRewarded) arrive on the listener passed to initIronSource

Input

輸入

输入

FieldTypeDescription
rewardVideoRewardVideoBuilt with a placement name and a network-state flag.
rewardVideo.placementNameStringPlacement to show.
rewardVideo.trackNetworkStateBooleanWhether to track network state.
欄位型別說明
rewardVideoRewardVideo以版位名稱與網路狀態旗標建構。
rewardVideo.placementNameString要顯示的版位。
rewardVideo.trackNetworkStateBoolean是否追蹤網路狀態。
字段类型描述
rewardVideoRewardVideo以广告位名称与网络状态标志构建。
rewardVideo.placementNameString要展示的广告位。
rewardVideo.trackNetworkStateBoolean是否跟踪网络状态。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Set dynamic user id

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

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

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

PASS.setDynamicUserId("user-1");

Input

輸入

输入

FieldTypeDescription
userIDStringDynamic user id for verifying rewarded-ad transactions: set before showing the ad, returned in the server-to-server reward callback (1 to 64 alphanumeric characters).
欄位型別說明
userIDString用於驗證獎勵廣告交易的動態使用者 ID: 需在顯示廣告前設定。會在伺服器對伺服器獎勵回呼中回傳(1 至 64 個英數字元)。
字段类型描述
userIDString用于验证激励广告交易的动态用户 id: 需在展示广告前设置。会在服务端到服务端奖励回调中返回(1 至 64 个字母数字字符)。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Meta Audience Network

Show interstitial

Shows a Meta Audience Network interstitial.

顯示 Meta Audience Network 插頁式廣告。

展示一个 Meta Audience Network 插屏广告。

VGSDKMetaAdsInterstitialListener listener = new VGSDKMetaAdsInterstitialListener() {
    @Override
    public void adLoaded(Ad ad) { /* ready to show */ }
 
    @Override
    public void error(Ad ad, AdError adError) { /* load/show failed */ }
};
VGSDKMetaAds.showInterstitial("placement-id", listener);

Input

輸入

输入

FieldTypeDescription
placementIdStringMeta placement id.
listenerVGSDKMetaAdsInterstitialListenerAd-event listener.
欄位型別說明
placementIdStringMeta 版位 ID。
listenerVGSDKMetaAdsInterstitialListener廣告事件監聽器。
字段类型描述
placementIdStringMeta 广告位 id。
listenerVGSDKMetaAdsInterstitialListener广告事件监听器。

Output

輸出

输出

FieldTypeDescription
adLoaded(Ad?) -> UnitAd loaded.
interstitialDisplayed(Ad?) -> UnitInterstitial displayed.
interstitialDismissed(Ad?) -> UnitInterstitial dismissed.
adClicked(Ad?) -> UnitAd clicked.
loggingImpression(Ad?) -> UnitImpression logged.
error(Ad?, AdError?) -> UnitLoad/show failed: carries the native Meta AdError (not a VGSDK code).
欄位型別說明
adLoaded(Ad?) -> Unit廣告已載入。
interstitialDisplayed(Ad?) -> Unit插頁廣告已顯示。
interstitialDismissed(Ad?) -> Unit插頁廣告已關閉。
adClicked(Ad?) -> Unit廣告被點擊。
loggingImpression(Ad?) -> Unit已記錄曝光。
error(Ad?, AdError?) -> Unit載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。
字段类型描述
adLoaded(Ad?) -> Unit广告已加载。
interstitialDisplayed(Ad?) -> Unit插屏广告已展示。
interstitialDismissed(Ad?) -> Unit插屏广告已关闭。
adClicked(Ad?) -> Unit广告被点击。
loggingImpression(Ad?) -> Unit已记录曝光。
error(Ad?, AdError?) -> Unit加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。

Show rewarded video

Shows a Meta rewarded video. A complete closure fires when the reward is earned.

顯示 Meta 獎勵影片。當獲得獎勵時會觸發 complete 閉包。

展示一个 Meta 激励视频。获得奖励时触发 complete 闭包。

VGSDKMetaAdsRewardedVideoListener listener = new VGSDKMetaAdsRewardedVideoListener() {
    @Override
    public void rewardedVideoCompleted() { /* grant reward */ }
 
    @Override
    public void error(Ad ad, AdError adError) { /* load/show failed */ }
};
VGSDKMetaAds.showRewardedVideo("placement-id", "user-1", "gold", listener);

Input

輸入

输入

FieldTypeDescription
placementIdStringMeta placement id.
userIdStringPlayer id for the reward callback.
currencyStringReward currency name.
listenerVGSDKMetaAdsRewardedVideoListenerAd-event listener.
欄位型別說明
placementIdStringMeta 版位 ID。
userIdString用於獎勵回呼的玩家 ID。
currencyString獎勵貨幣名稱。
listenerVGSDKMetaAdsRewardedVideoListener廣告事件監聽器。
字段类型描述
placementIdStringMeta 广告位 id。
userIdString用于奖励回调的玩家 id。
currencyString奖励货币名称。
listenerVGSDKMetaAdsRewardedVideoListener广告事件监听器。

Output

輸出

输出

FieldTypeDescription
rewardedVideoCompleted() -> UnitReward earned: grant it here.
rewardedVideoClosed() -> UnitAd closed.
rewardServerSuccess() -> UnitServer-to-server reward callback succeeded.
rewardServerFailed() -> UnitServer-to-server reward callback failed.
adLoaded(Ad?) -> UnitAd loaded.
error(Ad?, AdError?) -> UnitLoad/show failed: carries the native Meta AdError (not a VGSDK code).
欄位型別說明
rewardedVideoCompleted() -> Unit獲得的獎勵: 在此發放。
rewardedVideoClosed() -> Unit廣告已關閉。
rewardServerSuccess() -> Unit伺服器對伺服器的獎勵回呼成功。
rewardServerFailed() -> Unit伺服器對伺服器的獎勵回呼失敗。
adLoaded(Ad?) -> Unit廣告已載入。
error(Ad?, AdError?) -> Unit載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。
字段类型描述
rewardedVideoCompleted() -> Unit获得的奖励: 在此发放。
rewardedVideoClosed() -> Unit广告已关闭。
rewardServerSuccess() -> Unit服务器到服务器的奖励回调成功。
rewardServerFailed() -> Unit服务器到服务器的奖励回调失败。
adLoaded(Ad?) -> Unit广告已加载。
error(Ad?, AdError?) -> Unit加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。

Show rewarded interstitial

Shows a Meta rewarded-interstitial (skippable rewarded format), with the same closure set as rewarded video.

顯示 Meta 獎勵式插頁廣告(可略過的獎勵格式),使用與獎勵影片相同的閉包集合。

展示一个 Meta 激励插屏广告(可跳过的激励格式),闭包集合与激励视频相同。

VGSDKMetaAdsRewardedInterstitialListener listener = new VGSDKMetaAdsRewardedInterstitialListener() {
    @Override
    public void rewardedInterstitialCompleted() { /* grant reward */ }
 
    @Override
    public void error(Ad ad, AdError adError) { /* load/show failed */ }
};
VGSDKMetaAds.showRewardedInterstitial("placement-id", "user-1", "gold", listener);

Input

輸入

输入

FieldTypeDescription
placementIdStringMeta placement id.
userIdStringPlayer id for the reward callback.
currencyStringReward currency name.
listenerVGSDKMetaAdsRewardedInterstitialListenerAd-event listener.
欄位型別說明
placementIdStringMeta 版位 ID。
userIdString用於獎勵回呼的玩家 ID。
currencyString獎勵貨幣名稱。
listenerVGSDKMetaAdsRewardedInterstitialListener廣告事件監聽器。
字段类型描述
placementIdStringMeta 广告位 id。
userIdString用于奖励回调的玩家 id。
currencyString奖励货币名称。
listenerVGSDKMetaAdsRewardedInterstitialListener广告事件监听器。

Output

輸出

输出

FieldTypeDescription
rewardedInterstitialCompleted() -> UnitReward earned: grant it here.
rewardedInterstitialClosed() -> UnitAd closed.
rewardServerSuccess() -> UnitServer-to-server reward callback succeeded.
rewardServerFailed() -> UnitServer-to-server reward callback failed.
adLoaded(Ad?) -> UnitAd loaded.
error(Ad?, AdError?) -> UnitLoad/show failed: carries the native Meta AdError (not a VGSDK code).
欄位型別說明
rewardedInterstitialCompleted() -> Unit獲得的獎勵: 在此發放。
rewardedInterstitialClosed() -> Unit廣告已關閉。
rewardServerSuccess() -> Unit伺服器對伺服器的獎勵回呼成功。
rewardServerFailed() -> Unit伺服器對伺服器的獎勵回呼失敗。
adLoaded(Ad?) -> Unit廣告已載入。
error(Ad?, AdError?) -> Unit載入/顯示失敗: 帶有原生 Meta AdError(非 VGSDK 代碼)。
字段类型描述
rewardedInterstitialCompleted() -> Unit获得的奖励: 在此发放。
rewardedInterstitialClosed() -> Unit广告已关闭。
rewardServerSuccess() -> Unit服务器到服务器的奖励回调成功。
rewardServerFailed() -> Unit服务器到服务器的奖励回调失败。
adLoaded(Ad?) -> Unit广告已加载。
error(Ad?, AdError?) -> Unit加载/展示失败: 携带原生 Meta AdError(非 VGSDK 代码)。

Engage

Re-engagement, grouped by provider. CleverTap covers in-app messaging and the app inbox. Apollo picks and delivers its messages on the backend, so the client’s job is to target them and, where the SDK exposes it, to decide when they may be displayed. Firebase Remote Config and the in-app WebView round it out. Firebase Cloud Messaging, local push, Apollo push, and Firebase in-app messages are delivered server-side and expose no client call.

再行銷,依供應商分組。CleverTap 涵蓋應用程式內訊息與應用程式收件匣。Apollo 的訊息由後端挑選並派送,因此用戶端的工作是鎖定投放對象,並在 SDK 有提供的情況下決定它們何時可以顯示。Firebase Remote Config 與應用程式內 WebView 補足其餘部分。Firebase Cloud Messaging、本機推播、Apollo 推播以及 Firebase 應用程式內訊息皆由伺服器端傳遞,不提供任何用戶端呼叫。

按提供方分组的再互动能力。CleverTap 负责应用内消息和应用收件箱。Apollo 的消息由后端挑选并下发,因此客户端的工作是定位投放对象,并在 SDK 有提供的情况下决定它们何时可以显示。此外还有 Firebase Remote Config 和应用内 WebView。Firebase Cloud Messaging、本地推送、Apollo 推送以及 Firebase 应用内消息均由服务端下发,不暴露客户端调用。

CleverTap

Set CleverTap listener

Registers a CleverTap listener for in-app message button taps.

註冊 CleverTap 監聽器以接收應用程式內訊息按鈕的點擊。

注册一个用于监听应用内消息按钮点击的 CleverTap 监听器。

PASS.setCleverTapInAppNotificationButtonListener(new CleverTapInAppNotificationButtonListener() {
    @Override
    public void onCleverTapInAppButtonClick(HashMap<String, String> payload) {
        // Handle the tapped in-app message button payload
    }
});

Input

輸入

输入

FieldTypeDescription
listenerCleverTapInAppNotificationButtonListenerListener for in-app-message button taps.
欄位型別說明
listenerCleverTapInAppNotificationButtonListener用於接收應用程式內訊息按鈕點擊的監聽器。
字段类型描述
listenerCleverTapInAppNotificationButtonListener用于接收应用内消息按钮点击的监听器。

Output

輸出

输出

FieldTypeDescription
onCleverTapInAppButtonClick(HashMap<String, String>?) -> UnitPayload of the tapped in-app message button.
欄位型別說明
onCleverTapInAppButtonClick(HashMap<String, String>?) -> Unit被點擊的應用程式內訊息按鈕的負載。
字段类型描述
onCleverTapInAppButtonClick(HashMap<String, String>?) -> Unit被点击的应用内消息按钮的负载。

Open the app inbox

Opens the CleverTap-backed inbox.

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

打开由 CleverTap 支持的收件箱。

VGSDKAppInboxCleverTapProvider provider =
    new VGSDKAppInboxCleverTapProvider(new VGSDKAppInboxCleverTapStyle());
VGSDKAppInbox.open(provider, new VGSDKCleverTapInboxListener() {
    @Override
    public void onItemClicked(VGSDKCleverTapInboxMessage message,
                              VGSDKCleverTapInboxMessageContent messageContent,
                              HashMap<String, String> buttonDataPayload) {
        // Handle the tapped message + CTA payload
    }
});

Input

輸入

输入

FieldTypeDescription
providerVGSDKAppInboxCleverTapProviderThe CleverTap app-inbox provider.
provider.styleVGSDKAppInboxCleverTapStyleTheming (title, tabs, colors). Uses defaults when not customized.
listenerVGSDKCleverTapInboxListenerInbox listener.
欄位型別說明
providerVGSDKAppInboxCleverTapProviderCleverTap 應用程式收件匣供應商。
provider.styleVGSDKAppInboxCleverTapStyle主題設定(標題、分頁、色彩)。未自訂時使用預設值。
listenerVGSDKCleverTapInboxListener收件匣監聽器。
字段类型描述
providerVGSDKAppInboxCleverTapProviderCleverTap 应用收件箱提供方。
provider.styleVGSDKAppInboxCleverTapStyle主题设置(标题、标签、颜色)。未自定义时使用默认值。
listenerVGSDKCleverTapInboxListener收件箱监听器。

Output

輸出

输出

FieldTypeDescription
onItemClicked(VGSDKCleverTapInboxMessage, VGSDKCleverTapInboxMessageContent, HashMap<String, String>?) -> UnitThe tapped message, its content, and any CTA button payload.
欄位型別說明
onItemClicked(VGSDKCleverTapInboxMessage, VGSDKCleverTapInboxMessageContent, HashMap<String, String>?) -> Unit被點擊的訊息、其內容,以及任何 CTA 負載。
字段类型描述
onItemClicked(VGSDKCleverTapInboxMessage, VGSDKCleverTapInboxMessageContent, HashMap<String, String>?) -> Unit被点击的消息、其内容以及任何 CTA 负载。

Apollo

Set the game context

Registers the active role/server. Apollo messaging and inbox target on this context, and analytics and support also read it. Both ids must be non-empty or the call is ignored.

註冊使用中的角色/伺服器。Apollo 的訊息與收件匣會以此情境為鎖定目標。分析與支援也會讀取它。兩個 ID 都必須為非空,否則此呼叫會被忽略。

注册当前的角色 / 服务器。Apollo 的消息和收件箱基于此上下文定位。分析与客户支持也会读取它。两个 id 都必须非空,否则该调用被忽略。

Changing the context discards the in-app messages still waiting to display, because they were targeted at the role that was active when they arrived. An in-app message already on screen is left alone and runs until the player closes it.

變更情境會捨棄仍在等待顯示的應用程式內訊息,因為它們是針對訊息送達當下所在的角色投放的。已經在畫面上的應用程式內訊息不受影響,會持續到玩家關閉為止。

变更上下文会丢弃仍在等待显示的应用内消息,因为它们是针对消息送达当时所在的角色投放的。已经在屏幕上的应用内消息不受影响,会持续到玩家关闭为止。

VGSDKGameContext context = new VGSDKGameContext("role-1", "server-1");
VGSDK.setGameContext(context);

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Registers a listener for deep links fired by Apollo in-app messages / inbox.

註冊監聽器以接收 Apollo 應用程式內訊息/收件匣觸發的深層連結。

注册一个用于监听 Apollo 应用内消息 / 收件箱触发的深链的监听器。

VGSDKAppInbox.setInAppMessageDeepLinkListener(new VGSDKInAppMessageDeepLinkListener() {
    @Override
    public void onDeepLink(String value) { /* route the deep link */ }
});

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
onDeepLink(String) -> UnitThe deep-link URL string to route.
欄位型別說明
onDeepLink(String) -> Unit要路由的深層連結 URL 字串。
字段类型描述
onDeepLink(String) -> Unit要路由的深链 URL 字符串。

Show the app inbox floating button

Displays the Apollo app inbox floating button and allows automatic in-app messages, taking both over for the rest of the session.

顯示 Apollo 應用程式內收件匣的浮動按鈕,並允許自動顯示應用程式內訊息,在本次工作階段一併接手兩者。

显示 Apollo 应用内收件箱的悬浮按钮,并允许自动显示应用内消息,在本次会话一并接手两者。

One control for both surfaces: it hides or restores the floating button and automatic in-app messages together, so your game can keep the app inbox out of a match and bring it back in the lobby. The first call takes that decision over for the rest of the session, and it resets on logout and relaunch.

同一組控制同時作用於兩處:浮動按鈕與自動顯示的應用程式內訊息會一起隱藏或恢復,因此你的遊戲可以在戰鬥中收起收件匣,回到大廳再放出來。第一次呼叫後,該決定在本次工作階段交由遊戲掌控,並在登出與重新啟動時歸還 SDK。

同一组控制同时作用于两处:悬浮按钮与自动展示的应用内消息会一起隐藏或恢复,因此你的游戏可以在战斗中收起收件箱,回到大厅再放出来。第一次调用后,该决定在本次会话交由游戏掌控,并在登出与重新启动时归还 SDK。

VGSDKAppInbox.showFloatingButton();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Hide the app inbox floating button

Removes the Apollo app inbox floating button and suppresses automatic in-app messages, taking both over for the rest of the session.

移除 Apollo 應用程式內收件匣的浮動按鈕,並暫停自動顯示應用程式內訊息,在本次工作階段一併接手兩者。

移除 Apollo 应用内收件箱的悬浮按钮,并暂停自动显示应用内消息,在本次会话一并接手两者。

Hiding takes the app inbox out of the player’s way without losing anything. A message arriving meanwhile updates the unread count and waits for the next show, and whatever is already on screen stays until the player closes it. What is pending is dropped only on an identity change: logout, the next login, or a role change.

隱藏只是把收件匣從玩家眼前移開,不會丟掉任何內容。期間收到的訊息仍會更新未讀數量並等待下一次顯示,玩家正在看的內容也會保留,直到玩家自己關閉。仍在等待的內容只在身分變化時被丟棄:登出、下一次登入成功、或切換所投放的角色。

隐藏只是把收件箱从玩家眼前移开,不会丢掉任何内容。期间收到的消息仍会更新未读数量并等待下一次显示,玩家正在看的内容也会保留,直到玩家自己关闭。仍在等待的内容只在身份变化时被丢弃:登出、下一次登录成功、或切换所投放的角色。

VGSDKAppInbox.hideFloatingButton();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Notification

Add a custom sound

Deliver a custom sound with push notifications: no API call, just ship the audio file with your app:

  1. Prepare the sound file: .mp3 / .wav / .ogg, a short tone. The filename must be lowercase letters, digits, and underscores only ([a-z0-9_]), since it becomes a resource name.
  2. Put it in res/raw/ of your app module.
  3. Reference it by resource name in the push payload’s sound field: the extension is ignored (my_notification and my_notification.mp3 both resolve res/raw/my_notification). If the name doesn’t resolve, the default notification sound is used.

為推播通知提供自訂音效:無需 API 呼叫,只要將音訊檔隨應用程式一起打包:

  1. 準備音效檔:.mp3 / .wav / .ogg,一段簡短的提示音。檔名只能使用小寫字母、數字與底線([a-z0-9_]),因為它會成為資源名稱。
  2. 將其放入應用程式模組的 res/raw/。
  3. 於推播負載的 sound 欄位中以資源名稱參照它:副檔名會被忽略(my_notification 和 my_notification.mp3 都會解析到 res/raw/my_notification)。若名稱無法解析,則使用預設通知音效。

为推送通知提供自定义声音:无需 API 调用,只需将音频文件随应用一起打包:

  1. 准备声音文件:.mp3 / .wav / .ogg,一段简短的提示音。文件名只能使用小写字母、数字和下划线([a-z0-9_]),因为它会成为资源名。
  2. 将其放入应用模块的 res/raw/。
  3. 在推送负载的 sound 字段中按资源名引用它:扩展名会被忽略(my_notification 和 my_notification.mp3 都会解析到 res/raw/my_notification)。若名称无法解析,则使用默认通知声音。

Set the notification icon

Show a custom notification icon on Android:

  1. Prepare two icons: a small icon at 128×128 and a large icon at 256×256 (px).
  2. Create small_icon_notification.png and large_icon_notification.png from them, and save both in the res/drawable folder.
  3. Add the following to AndroidManifest.xml:

在 Android 上顯示自訂通知圖示:

  1. 準備兩個圖示:小圖示 128×128、大圖示 256×256(像素)。
  2. 依此建立 small_icon_notification.png 與 large_icon_notification.png,並將兩者儲存至 res/drawable 資料夾。
  3. 將以下內容加入 AndroidManifest.xml:

在 Android 上显示自定义通知图标:

  1. 准备两个图标:小图标 128×128、大图标 256×256(像素)。
  2. 据此创建 small_icon_notification.png 和 large_icon_notification.png,并将两者保存到 res/drawable 文件夹。
  3. 将以下内容添加到 AndroidManifest.xml:
<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/small_icon_notification"
    tools:replace="android:resource" />

Set the notification icon color

Tint the notification icon shown in the drop-down notification tray:

  1. Create res/values/color.xml if it doesn’t exist.
  2. Add a colorNotification entry: set its value to the HEX color you want (replace {your_icon_color}), for example #EC7710:

為下拉通知欄中顯示的通知圖示著色:

  1. 若不存在,建立 res/values/color.xml。
  2. 加入 colorNotification 項目:將其值設為你想要的 HEX 色彩(替換 {your_icon_color}),例如 #EC7710:

为下拉通知栏中显示的通知图标着色:

  1. 若不存在,创建 res/values/color.xml。
  2. 添加 colorNotification 条目:将其值设为你想要的 HEX 颜色(替换 {your_icon_color}),例如 #EC7710:
<color name="colorNotification">#EC7710</color>

Firebase

Fetch Firebase Remote Config

Fetches all remote-config keys.

取得所有 remote-config 鍵。

获取所有 remote-config 键。

PASS.fetchConfig(new RemoteConfigListener() {
    @Override
    public void onSuccess(Map<?, ?> configInfo) {
        // Read configInfo.get("your_key")
    }
 
    @Override
    public void onFail() { /* fetch failed */ }
});

Input

輸入

输入

FieldTypeDescription
listenerRemoteConfigListenerFetch-result listener. Override onSuccess/onFail.
欄位型別說明
listenerRemoteConfigListener擷取結果監聽器。覆寫 onSuccess/onFail。
字段类型描述
listenerRemoteConfigListener获取结果监听器。重写 onSuccess/onFail。

Output

輸出

输出

FieldTypeDescription
onSuccess(Map<*, *>) -> UnitAll remote-config keys and values.
onFail() -> UnitFetch failed (no error payload).
欄位型別說明
onSuccess(Map<*, *>) -> Unit所有遠端設定的鍵與值。
onFail() -> Unit擷取失敗(無錯誤負載)。
字段类型描述
onSuccess(Map<*, *>) -> Unit所有远程配置的键与值。
onFail() -> Unit获取失败(无错误负载)。

In-App WebView

Show in-app WebView

Opens a URL in an in-app WebView.

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

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

PASS.showWebView("https://example.com", new ShowPageListener() {
    @Override
    public void onComplete() { /* WebView dismissed */ }
 
    @Override
    public void onError(Error error) { /* failed to open */ }
});

Input

輸入

输入

FieldTypeDescription
urlString?URL to load.
pageListenerShowPageListenerWebView lifecycle listener.
欄位型別說明
urlString?要載入的 URL。
pageListenerShowPageListenerWebView 生命週期監聽器。
字段类型描述
urlString?要加载的 URL。
pageListenerShowPageListenerWebView 生命周期监听器。

Output

輸出

输出

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

Social

Read Facebook profile/friends and share to Facebook or Instagram. Facebook results are the raw Graph JSON (no typed model). Instagram callbacks return only an error (none = success).

讀取 Facebook 個人檔案/好友,並分享到 Facebook 或 Instagram。Facebook 的結果為原始的 Graph JSON(沒有型別化模型)。Instagram 的回呼僅傳回一個錯誤(不存在=成功)。

读取 Facebook 资料 / 好友,并分享到 Facebook 或 Instagram。Facebook 结果是原始的 Graph JSON(没有类型化模型)。Instagram 回调仅返回一个错误(不存在 = 成功)。

Get Facebook profile

Returns the player’s Facebook profile as raw Graph JSON.

以原始 Graph JSON 傳回玩家的 Facebook 個人檔案。

以原始 Graph JSON 形式返回玩家的 Facebook 资料。

PASS.getProfileSocial(SocialType.FACEBOOK, new SocialListener<SocialUserInfo>() {
    @Override
    public void onSuccess(SocialUserInfo profile) {
        // Typed model: profile.userID, profile.name, profile.avatarImageURL
    }
 
    @Override
    public void onFail(String message) { /* handle failure */ }
 
    @Override
    public void onCancel() { /* user dismissed */ }
});

Input

輸入

输入

FieldTypeDescription
socialTypeSocialTypeSocial channel to read (Facebook): see SocialType.
listenerSocialListener<SocialUserInfo>Result listener (onSuccess / onFail / onCancel).
欄位型別說明
socialTypeSocialType要讀取的社群頻道(Facebook): 請參閱 SocialType。
listenerSocialListener<SocialUserInfo>結果監聽器(onSuccess / onFail / onCancel)。
字段类型描述
socialTypeSocialType要读取的社交渠道(Facebook): 请参阅 SocialType。
listenerSocialListener<SocialUserInfo>结果监听器(onSuccess / onFail / onCancel)。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: SocialUserInfo) -> UnitDelivers the typed profile model (not raw JSON). Fields: SocialUserInfo.
onFail(message: String?) -> UnitCalled on failure with an error message.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: SocialUserInfo) -> Unit傳回具型別的個人檔案模型(非原始 JSON)。欄位詳見 SocialUserInfo。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: SocialUserInfo) -> Unit返回带类型的资料模型(非原始 JSON)。字段详见 SocialUserInfo。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。
onCancel() -> Unit当玩家关闭流程时调用。

Get Facebook friends

Returns friends using the app as raw Graph dictionaries.

以原始 Graph 字典傳回正在使用此應用程式的好友。

以原始 Graph 字典形式返回正在使用该应用的好友。

PASS.getFriendsSocial(new GetFriendsSocialType.Facebook(0, 50),
    new SocialListener<List<SocialUserInfo>>() {
        @Override
        public void onSuccess(List<SocialUserInfo> friends) { /* app friends */ }
 
        @Override
        public void onFail(String message) { /* handle failure */ }
 
        @Override
        public void onCancel() { /* user dismissed */ }
    });

Input

輸入

输入

FieldTypeDescription
getFriendsSocialTypeGetFriendsSocialType.FacebookFacebook friends query: full model: GetFriendsSocialType.
listenerSocialListener<List<SocialUserInfo>>Result listener (onSuccess / onFail / onCancel).
欄位型別說明
getFriendsSocialTypeGetFriendsSocialType.FacebookFacebook 好友查詢: 完整模型:GetFriendsSocialType。
listenerSocialListener<List<SocialUserInfo>>結果監聽器(onSuccess / onFail / onCancel)。
字段类型描述
getFriendsSocialTypeGetFriendsSocialType.FacebookFacebook 好友查询: 完整模型:GetFriendsSocialType。
listenerSocialListener<List<SocialUserInfo>>结果监听器(onSuccess / onFail / onCancel)。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: List<SocialUserInfo>) -> UnitDelivers the app friends as typed models (not raw JSON). Each entry: SocialUserInfo.
onFail(message: String?) -> UnitCalled on failure with an error message.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: List<SocialUserInfo>) -> Unit以具型別的模型傳回使用此應用程式的好友(非原始 JSON)。每個項目:SocialUserInfo。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: List<SocialUserInfo>) -> Unit以带类型的模型返回使用该应用的好友(非原始 JSON)。每个条目:SocialUserInfo。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。
onCancel() -> Unit当玩家关闭流程时调用。

Invite Facebook friends

Opens the Facebook invite dialog.

開啟 Facebook 邀請對話框。

打开 Facebook 邀请对话框。

PASS.inviteFriends(
    new InviteFriendsSocialType.Facebook("Join!", SocialFriendType.APP_USERS),
    new SocialListener<List<String>>() {
        @Override
        public void onSuccess(List<String> invitedIds) { /* invited friend ids */ }
 
        @Override
        public void onFail(String message) { /* handle failure */ }
 
        @Override
        public void onCancel() { /* user dismissed */ }
    });

Input

輸入

输入

FieldTypeDescription
inviteFriendsSocialTypeInviteFriendsSocialType.FacebookFacebook invite request: full model: InviteFriendsSocialType.
listenerSocialListener<List<String>>Result listener (onSuccess / onFail / onCancel).
欄位型別說明
inviteFriendsSocialTypeInviteFriendsSocialType.FacebookFacebook 邀請請求: 完整模型:InviteFriendsSocialType。
listenerSocialListener<List<String>>結果監聽器(onSuccess / onFail / onCancel)。
字段类型描述
inviteFriendsSocialTypeInviteFriendsSocialType.FacebookFacebook 邀请请求: 完整模型:InviteFriendsSocialType。
listenerSocialListener<List<String>>结果监听器(onSuccess / onFail / onCancel)。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: List<String>) -> UnitIds of the friends that were invited.
onFail(message: String?) -> UnitCalled on failure with an error message.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: List<String>) -> Unit已被邀請的好友 id。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: List<String>) -> Unit已被邀请的好友 id。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。
onCancel() -> Unit当玩家关闭流程时调用。

Share photo to Facebook

Shares a photo through the Facebook share dialog.

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

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

The Facebook app must be installed. The share dialog opens inside the Facebook app, so a device without it never reaches the dialog and the share fails.

必須安裝 Facebook 應用程式。 分享對話框是在 Facebook 應用程式中開啟,因此未安裝的裝置永遠不會進入該對話框,分享也會失敗。

必须安装 Facebook 应用。 分享对话框是在 Facebook 应用中打开,因此未安装的设备永远不会进入该对话框,分享也会失败。

// bitmap: the android.graphics.Bitmap to share
PASS.shareToSocial(new ShareType.FacebookPhoto("Check this out", bitmap),
    new SocialListener<Object>() {
        @Override
        public void onSuccess(Object result) { /* shared */ }
 
        @Override
        public void onFail(String message) { /* handle failure */ }
 
        @Override
        public void onCancel() { /* user dismissed */ }
    });

Input

輸入

输入

FieldTypeDescription
shareTypeShareType.FacebookPhotoFacebook photo share (via shareToSocial): full model: ShareType.
listenerSocialListener<Any>Result listener. Facebook shares resolve the result to Any/Object.
欄位型別說明
shareTypeShareType.FacebookPhotoFacebook 相片分享(透過 shareToSocial): 完整模型:ShareType。
listenerSocialListener<Any>結果監聽器。Facebook 分享會將結果解析為 Any/Object。
字段类型描述
shareTypeShareType.FacebookPhotoFacebook 照片分享(通过 shareToSocial): 完整模型:ShareType。
listenerSocialListener<Any>结果监听器。Facebook 分享会将结果解析为 Any/Object。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: Any) -> UnitThe photo was shared.
onFail(message: String?) -> UnitCalled on failure with an error message. When the Facebook app is missing the SDK shows its own install prompt and then reports the failure here, so the game does not need to prompt for the install.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: Any) -> Unit相片已分享。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。當裝置未安裝 Facebook 應用程式時,SDK 會先顯示自己的安裝提示,再於此處回報失敗,因此遊戲不需要另外提示安裝。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: Any) -> Unit照片已分享。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。当设备未安装 Facebook 应用时,SDK 会先显示自己的安装提示,再在此处报告失败,因此游戏不需要另外提示安装。
onCancel() -> Unit当玩家关闭流程时调用。

Shares a link.

分享連結。

分享一个链接。

The Facebook app must be installed. The share dialog opens inside the Facebook app, so a device without it never reaches the dialog and the share fails.

必須安裝 Facebook 應用程式。 分享對話框是在 Facebook 應用程式中開啟,因此未安裝的裝置永遠不會進入該對話框,分享也會失敗。

必须安装 Facebook 应用。 分享对话框是在 Facebook 应用中打开,因此未安装的设备永远不会进入该对话框,分享也会失败。

PASS.shareToSocial(
    new ShareType.FacebookLink("Title", "Description", "https://example.com", null),
    new SocialListener<Object>() {
        @Override
        public void onSuccess(Object result) { /* shared */ }
 
        @Override
        public void onFail(String message) { /* handle failure */ }
 
        @Override
        public void onCancel() { /* user dismissed */ }
    });

Input

輸入

输入

FieldTypeDescription
shareTypeShareType.FacebookLinkFacebook link share (via shareToSocial): full model: ShareType.
listenerSocialListener<Any>Result listener. Facebook shares resolve the result to Any/Object.
欄位型別說明
shareTypeShareType.FacebookLinkFacebook 連結分享(透過 shareToSocial): 完整模型:ShareType。
listenerSocialListener<Any>結果監聽器。Facebook 分享會將結果解析為 Any/Object。
字段类型描述
shareTypeShareType.FacebookLinkFacebook 链接分享(通过 shareToSocial): 完整模型:ShareType。
listenerSocialListener<Any>结果监听器。Facebook 分享会将结果解析为 Any/Object。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: Any) -> UnitThe link was shared.
onFail(message: String?) -> UnitCalled on failure with an error message. When the Facebook app is missing the SDK shows its own install prompt and then reports the failure here, so the game does not need to prompt for the install.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: Any) -> Unit連結已分享。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。當裝置未安裝 Facebook 應用程式時,SDK 會先顯示自己的安裝提示,再於此處回報失敗,因此遊戲不需要另外提示安裝。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: Any) -> Unit链接已分享。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。当设备未安装 Facebook 应用时,SDK 会先显示自己的安装提示,再在此处报告失败,因此游戏不需要另外提示安装。
onCancel() -> Unit当玩家关闭流程时调用。

Share to Instagram feed

Shares an image to the Instagram feed.

將圖片分享到 Instagram 動態。

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

// imageUri: android.net.Uri of the image to share
PASS.shareToSocial(new ShareType.InstagramPhotoFeed(imageUri),
    new SocialListener<String>() {
        @Override
        public void onSuccess(String result) { /* shared */ }
 
        @Override
        public void onFail(String message) { /* handle failure */ }
 
        @Override
        public void onCancel() { /* user dismissed */ }
    });

Input

輸入

输入

FieldTypeDescription
shareTypeShareType.InstagramPhotoFeedInstagram feed image share (via shareToSocial): full model: ShareType.
listenerSocialListener<String>Result listener. Instagram shares resolve the result to String.
欄位型別說明
shareTypeShareType.InstagramPhotoFeedInstagram 動態圖片分享(透過 shareToSocial): 完整模型:ShareType。
listenerSocialListener<String>結果監聽器。Instagram 分享會將結果解析為 String。
字段类型描述
shareTypeShareType.InstagramPhotoFeedInstagram 动态图片分享(通过 shareToSocial): 完整模型:ShareType。
listenerSocialListener<String>结果监听器。Instagram 分享会将结果解析为 String。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: String) -> UnitThe image was shared to the Instagram feed.
onFail(message: String?) -> UnitCalled on failure with an error message.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: String) -> Unit圖片已分享到 Instagram 動態。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: String) -> Unit图片已分享到 Instagram 动态。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。
onCancel() -> Unit当玩家关闭流程时调用。

Share to Instagram Stories

Shares an image to Instagram Stories.

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

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

// imageUri: android.net.Uri of the image to share
PASS.shareToSocial(new ShareType.InstagramPhotoStory(imageUri),
    new SocialListener<String>() {
        @Override
        public void onSuccess(String result) { /* shared */ }
 
        @Override
        public void onFail(String message) { /* handle failure */ }
 
        @Override
        public void onCancel() { /* user dismissed */ }
    });

Input

輸入

输入

FieldTypeDescription
shareTypeShareType.InstagramPhotoStoryInstagram Stories image share (via shareToSocial): full model: ShareType.
listenerSocialListener<String>Result listener. Instagram shares resolve the result to String.
欄位型別說明
shareTypeShareType.InstagramPhotoStoryInstagram 限時動態圖片分享(透過 shareToSocial): 完整模型:ShareType。
listenerSocialListener<String>結果監聽器。Instagram 分享會將結果解析為 String。
字段类型描述
shareTypeShareType.InstagramPhotoStoryInstagram 快拍图片分享(通过 shareToSocial): 完整模型:ShareType。
listenerSocialListener<String>结果监听器。Instagram 分享会将结果解析为 String。

Output

輸出

输出

FieldTypeDescription
onSuccess(result: String) -> UnitThe image was shared to Instagram Stories.
onFail(message: String?) -> UnitCalled on failure with an error message.
onCancel() -> UnitCalled when the player dismisses the flow.
欄位型別說明
onSuccess(result: String) -> Unit圖片已分享到 Instagram 限時動態。
onFail(message: String?) -> Unit失敗時呼叫,並帶有錯誤訊息。
onCancel() -> Unit當玩家關閉流程時呼叫。
字段类型描述
onSuccess(result: String) -> Unit图片已分享到 Instagram 快拍。
onFail(message: String?) -> Unit失败时调用,并带有错误消息。
onCancel() -> Unit当玩家关闭流程时调用。

User Experience

Native store rating prompt and in-chat Google Translate.

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

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

Store rating (in-app review)

Triggers the native in-app review sheet (subject to the OS’s display limits).

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

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

PASS.rating();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Translate text

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

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

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

PASS.translate("Hello", "vi", new TranslateListener() {
    @Override
    public void onComplete(String output) {
        // output == "Xin chào"
    }
});

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
outputStringThe translated text.
欄位型別說明
outputString翻譯後的文字。
字段类型描述
outputString翻译后的文本。

Compliance

Ask the store what age band the signed in player falls into. The SDK maps both stores onto one result shape, so your game writes one branch. Needs Android 6.0 and a build installed by Google Play. Distributed any other way it answers UNAVAILABLE / DEVICE_NOT_ELIGIBLE.

向商店查詢已登入玩家所屬的年齡區間。SDK 會把兩家商店對應到同一種結果結構,你的遊戲只需要寫一套分支。需要 Android 6.0,且版本必須由 Google Play 安裝。以其他方式發佈時會回傳 UNAVAILABLE / DEVICE_NOT_ELIGIBLE。

向商店查询已登录玩家所属的年龄区间。SDK 会把两家商店映射到同一种结果结构,你的游戏只需要写一套分支。需要 Android 6.0,且版本必须由 Google Play 安装。以其他方式发布时会返回 UNAVAILABLE / DEVICE_NOT_ELIGIBLE。

Request age signals

Asks the store for the signed in player’s age band.

向商店查詢已登入玩家的年齡區間。

向商店查询已登录玩家的年龄区间。

The SDK shows a dialog on every outcome except a shared band, and your callback fires only after the player dismisses it. A failing call can take about three seconds, because the SDK retries a store-connection failure twice. The first answer is then reused for the session, dialog included, until the app returns to the foreground or the player signs in or out.

除了成功取得年齡區間之外,SDK 會在每一種結果都顯示對話框,而你的 callback 要等玩家關閉它之後才會觸發。 失敗的呼叫大約會花三秒,因為 SDK 會對商店連線失敗重試兩次。第一次的答案接著會在這個工作階段重複使用,連同對話框一起,直到 App 回到前景或玩家登入、登出為止。

除了成功取得年龄区间之外,SDK 会在每一种结果都显示对话框,而你的回调要等玩家关闭它之后才会触发。 失败的调用大约会花三秒,因为 SDK 会对商店连接失败重试两次。第一次的答案接着会在这个会话中重复使用,连同对话框一起,直到 App 回到前台或玩家登录、登出为止。

VGSDKCompliance.requestAgeSignals(signal -> {
    switch (signal.getAccess()) {
        case SHARED:
            // signal.getRange() holds the band: lower and upper, either of which may be absent
            break;
        case VERIFICATION_REQUIRED:
            // The player verifies in Google Play, then a later call reflects it
            break;
        default:
            // signal.getReason() carries the cause, signal.getError() the number shown
            break;
    }
});

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
signalVGSDKAgeSignalThe age signal. Branch on access first, then on reason when you need the cause. Full model: VGSDKAgeSignal.
欄位型別說明
signalVGSDKAgeSignal年齡訊號。請先依 access 分支,需要知道原因時再看 reason。完整模型:VGSDKAgeSignal。
字段类型描述
signalVGSDKAgeSignal年龄信号。请先按 access 分支,需要知道原因时再看 reason。完整模型:VGSDKAgeSignal。

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 版本。

String version = PASS.getSDKVersion();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
versionStringThe SDK version string.
欄位型別說明
versionStringSDK 版本字串。
字段类型描述
versionStringSDK 版本字符串。

Get current language

Returns the SDK’s active language code.

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

返回 SDK 的当前语言代码。

String language = PASS.getLanguage();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Get current user

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

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

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

UserInfo user = PASS.getCurrentUserInfo();
if (user != null) {
    // user.userId, user.displayName, user.sessionId
}

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

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(其他)。

String code = PASS.getCountryCode();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Get device id

Returns a per-device identifier: the advertising id when available, otherwise a fallback device id: used when the advertising id is unavailable or all-zero (e.g. tracking not authorized). Dashes are replaced with underscores.

傳回每台裝置的識別碼:可用時為廣告識別碼,否則為備用裝置識別碼: 於廣告識別碼無法使用或全為零時使用(例如未授權追蹤)。連字號會以底線取代。

返回每设备标识符:可用时为广告标识符,否则为备用设备标识符: 在广告标识符不可用或全为零时使用(例如未授权跟踪)。连字符会被替换为下划线。

String deviceId = PASS.getDeviceID();

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

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

VGSDKSupportInfo

Player context passed to Open support center.

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

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

Fields

欄位

字段

FieldTypeDescription
userIdString?Unique VNGGames user id.
serverIdString?Game server id.
levelString?Player level.
roleNameString?Character/role name.
loginChannelString?Login channel.
guildString?Guild name.
contentString?Pre-filled ticket content.
欄位型別說明
userIdString?VNGGames 唯一使用者 id。
serverIdString?遊戲伺服器 id。
levelString?玩家等級。
roleNameString?角色名稱。
loginChannelString?登入頻道。
guildString?公會名稱。
contentString?預先填入的工單內容。
字段类型描述
userIdString?唯一的 VNGGames 用户 id。
serverIdString?游戏服务器 id。
levelString?玩家等级。
roleNameString?角色名称。
loginChannelString?登录渠道。
guildString?公会名称。
contentString?预填的工单内容。

VGSDKAnalyticsProvider

Analytics provider selector for sendCustomEvent (Int enum).

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

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

Fields

欄位

字段

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

Analytics default parameters

The default parameters the analytics facade merges into every event it triggers. The SDK fills them automatically: you never set them, and each method’s own inputs and any extraData you pass are added on top. device_info, user_info, response_info, and login_info are JSON-encoded strings. The last two are conditional: see their rows. Used by every method in Analytics.

分析門面合併到它所觸發之每個事件的預設參數。SDK 會自動填入: 你永遠不需設定。每個方法自身的輸入以及你傳入的任何 extraData 會再疊加於其上。device_info、user_info、response_info 與 login_info 為 JSON 編碼字串。後兩者為條件性: 請參閱其對應列。由 分析 中的每個方法使用。

分析门面合并到它触发的每个事件中的默认参数。SDK 会自动填充它们: 你无需设置。每个方法自身的输入以及你传入的任何 extraData 都会叠加在其之上。device_info、user_info、response_info 和 login_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.
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_id、social_id、country_code。登出時這些 ID 為空。
appsflyer_idStringAppsFlyer 裝置 UID。
frb_installation_idStringFirebase 安裝 ID。
frb_app_instance_idStringFirebase 應用程式執行個體 ID。
response_infoString僅在回報結果的事件上加入。JSON 編碼:status(Success/Failed/Canceled)、error_code、remote(0 本機、1 遠端)。
login_infoString僅在登入流程事件上加入。JSON 編碼: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_id、social_id、country_code。未登录时这些 id 为空。
appsflyer_idStringAppsFlyer 设备 UID。
frb_installation_idStringFirebase 安装 id。
frb_app_instance_idStringFirebase 应用实例 id。
response_infoString仅在报告结果的事件上添加。JSON 编码:status(Success / Failed / Canceled)、error_code、remote(0 本地,1 远程)。
login_infoString仅在登录流程事件上添加。JSON 编码:method、channel、flow(CreateUser / UpdateUser)、step。

Analytics platform prefixes

The per-provider prefix the VNGGames SDK inserts into every event it triggers: each event reaches its provider as vgsdk_{prefix}_{event name} (for example, vgsdk_af_app_open). Used by every method in Analytics.

VNGGames SDK 插入到它所觸發之每個事件中的各供應商前綴: 每個事件會以 vgsdk_{prefix}_{event name} 抵達其供應商(例如 vgsdk_af_app_open)。由 分析 中的每個方法使用。

VNGGames SDK 插入到它触发的每个事件中的每提供方前缀: 每个事件以 vgsdk_{prefix}_{event name} 形式到达其提供方(例如 vgsdk_af_app_open)。分析 中的每个方法都会使用它。

Fields

欄位

字段

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

Ad revenue mediation network

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

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

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

Fields

欄位

字段

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

SocialType

The login channel: passed to Direct login to sign in to a specific channel, and to the social profile/friends calls to select the network (Facebook is supported). The Type column is each case’s JSON-serialized value.

登入頻道: 傳入「直接登入」以登入特定頻道,並傳入社群個人檔案/好友呼叫以選擇網路(支援 Facebook)。Type 欄位為各項目的 JSON 序列化值。

登录渠道: 传入“直接登录”以登录特定渠道,并传入社交资料/好友调用以选择网络(支持 Facebook)。Type 列为各项的 JSON 序列化值。

Fields

欄位

字段

FieldTypeDescription
.FACEBOOKFacebookFacebook.
.ZINGIDZingIDZing ID.
.GOOGLEGoogleGoogle.
.EMAILEmailEmail.
.GUESTGuestAnonymous guest.
.INSTAGRAMInstagramInstagram.
.APPLEAppleSign in with Apple.
欄位型別說明
.FACEBOOKFacebookFacebook。
.ZINGIDZingIDZing ID。
.GOOGLEGoogleGoogle。
.EMAILEmail電子郵件。
.GUESTGuest匿名訪客。
.INSTAGRAMInstagramInstagram。
.APPLEApple使用 Apple 登入。
字段类型描述
.FACEBOOKFacebookFacebook。
.ZINGIDZingIDZing ID。
.GOOGLEGoogleGoogle。
.EMAILEmail电子邮箱。
.GUESTGuest匿名访客。
.INSTAGRAMInstagramInstagram。
.APPLEAppleSign in with Apple。

UserInfo

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

已登入的玩家,由每個登入回呼以及目前使用者存取器傳回。

已登录的玩家,由每个登录回调以及当前用户访问器返回。

Fields

欄位

字段

FieldTypeDescription
userIdString?Unique VNGGames user id.
sessionIdString?Session token used to authenticate backend calls.
displayNameString?Player display name.
lastUpdateSessionLongEpoch millis of the last session refresh.
mapBooleanWhether the account is protected/secured.
loginType()IntAccessor: the login channel value: 1 Facebook, 3 Google, 4 ZingID, 5 Guest, 7 Apple, 8 Email.
loginTypeForTracking()StringThe login channel as a string.
欄位型別說明
userIdString?VNGGames 唯一使用者 id。
sessionIdString?用於驗證後端呼叫的工作階段權杖。
displayNameString?玩家顯示名稱。
lastUpdateSessionLong上次工作階段重新整理的 Epoch 毫秒數。
mapBoolean帳號是否受保護/已加固。
loginType()Int存取器: 登入頻道值:1 Facebook、3 Google、4 ZingID、5 Guest、7 Apple、8 Email。
loginTypeForTracking()String以字串表示的登入頻道。
字段类型描述
userIdString?唯一的 VNGGames 用户 id。
sessionIdString?用于验证后端调用的会话令牌。
displayNameString?玩家显示名称。
lastUpdateSessionLong最近一次会话刷新的 Epoch 毫秒数。
mapBoolean账号是否受保护 / 已加固。
loginType()Int访问器: 登录渠道值:1 Facebook、3 Google、4 ZingID、5 Guest、7 Apple、8 Email。
loginTypeForTracking()String以字符串表示的登录渠道。

SkuDetails

A sellable product returned by Get products.

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

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

Fields

欄位

字段

FieldTypeDescription
skuString?The configured item id from Store.
priceString?Store-formatted price string to show the player.
priceMicrosString?Price in micro-units, as a string: 1,000,000 = one currency unit.
currencyString?ISO currency code.
欄位型別說明
skuString?在商店設定的商品 id。
priceString?商店格式化後、用於向玩家顯示的價格字串。
priceMicrosString?以微單位表示、字串形式的價格: 1,000,000 = 一個 currency 單位。
currencyString?ISO 貨幣代碼。
字段类型描述
skuString?在商店配置的商品 id。
priceString?商店格式化后、用于向玩家展示的价格字符串。
priceMicrosString?以微单位表示、字符串形式的价格: 1,000,000 = 一个 currency 单位。
currencyString?ISO 货币代码。

PaymentInfo

The purchase request passed to Purchase.

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

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

Fields

欄位

字段

FieldTypeDescription
userIDStringBuyer’s VNGGames user id.
serverIDStringGame server id.
itemIDStringThe configured item id from Store.
appTransIDStringYour app-side transaction id, for reconciliation.
addInfoStringExtra passthrough data. Empty string when unused.
roleIDStringCharacter/role id.
欄位型別說明
userIDString購買者的 VNGGames 使用者 id。
serverIDString遊戲伺服器 id。
itemIDString在商店設定的商品 id。
appTransIDString你在 App 端的交易 id,用於對帳。
addInfoString額外的透傳資料。未使用時為空字串。
roleIDString角色 id。
字段类型描述
userIDString购买者的 VNGGames 用户 id。
serverIDString游戏服务器 id。
itemIDString在商店配置的商品 id。
appTransIDString你在 App 端的交易 id,用于对账。
addInfoString额外的透传数据。未使用时为空字符串。
roleIDString角色 id。

SocialUserInfo

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

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

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

Fields

欄位

字段

FieldTypeDescription
userIDString?VNGGames/Facebook user id.
nameString?Display name.
avatarImageURLString?Profile picture URL.
欄位型別說明
userIDString?VNGGames/Facebook 使用者 id。
nameString?顯示名稱。
avatarImageURLString?個人檔案圖片 URL。
字段类型描述
userIDString?VNGGames/Facebook 用户 id。
nameString?显示名称。
avatarImageURLString?头像图片 URL。

SocialFriendType

Audience filter for Invite Facebook friends (enum). The Type column is each case’s name.

「邀請 Facebook 好友」的對象篩選(列舉)。Type 欄位為各項目的名稱。

“邀请 Facebook 好友”的受众筛选(枚举)。Type 列为各项的名称。

Fields

欄位

字段

FieldTypeDescription
.ALL_USERSALL_USERSAll friends.
.APP_USERSAPP_USERSFriends who already use the app.
.APP_NON_USERSAPP_NON_USERSFriends who don’t use the app.
欄位型別說明
.ALL_USERSALL_USERS所有好友。
.APP_USERSAPP_USERS已在使用此應用程式的好友。
.APP_NON_USERSAPP_NON_USERS尚未使用此應用程式的好友。
字段类型描述
.ALL_USERSALL_USERS所有好友。
.APP_USERSAPP_USERS已在使用该应用的好友。
.APP_NON_USERSAPP_NON_USERS尚未使用该应用的好友。

InviteFriendsSocialType

The invite request passed to Invite Facebook friends. Variant .Facebook(message, friendType):

傳入「邀請 Facebook 好友」的邀請請求。變體 .Facebook(message, friendType):

传入“邀请 Facebook 好友”的邀请请求。变体 .Facebook(message, friendType):

Fields

欄位

字段

FieldTypeDescription
messageStringInvite message shown in the dialog.
friendTypeSocialFriendTypeAudience filter: see SocialFriendType.
欄位型別說明
messageString在對話框中顯示的邀請訊息。
friendTypeSocialFriendType對象篩選: 請參閱 SocialFriendType。
字段类型描述
messageString在对话框中显示的邀请消息。
friendTypeSocialFriendType受众筛选: 请参阅 SocialFriendType。

GetFriendsSocialType

The friends query passed to Get Facebook friends. Variant .Facebook(offset, count):

傳入「取得 Facebook 好友」的好友查詢。變體 .Facebook(offset, count):

传入“获取 Facebook 好友”的好友查询。变体 .Facebook(offset, count):

Fields

欄位

字段

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

ShareType

The share request passed to the Facebook / Instagram share methods (sealed class). Pick the variant for your target. Each carries its own fields:

傳入 Facebook/Instagram 分享方法的分享請求(sealed class)。為你的目標選擇對應變體。每個變體各自帶有欄位:

传入 Facebook/Instagram 分享方法的分享请求(sealed class)。为你的目标选择对应变体。每个变体各自带有字段:

Fields

欄位

字段

FieldTypeDescription
.FacebookPhotoShareType.FacebookPhotoShare a photo to Facebook: supply the image as a Uri or a Bitmap.
.FacebookPhoto.titleString?Optional caption/title.
.FacebookPhoto.imageURIUri?Photo to share, as a content Uri (android.net.Uri): primary constructor.
.FacebookPhoto.bitmapBitmap?Photo to share, as a Bitmap (android.graphics.Bitmap): alternate constructor, converted to a Uri internally.
.FacebookLinkShareType.FacebookLinkShare a link to Facebook.
.FacebookLink.titleString?Link title.
.FacebookLink.descriptionString?Link description.
.FacebookLink.redirectLinkString?URL to share.
.FacebookLink.imageURLString?Optional preview image URL.
.InstagramPhotoFeedShareType.InstagramPhotoFeedShare an image to the Instagram feed.
.InstagramPhotoFeed.imageURIUri?Image to share (android.net.Uri).
.InstagramPhotoStoryShareType.InstagramPhotoStoryShare an image to Instagram Stories.
.InstagramPhotoStory.imageURIUri?Image to share (android.net.Uri).
欄位型別說明
.FacebookPhotoShareType.FacebookPhoto分享相片到 Facebook: 以 Uri 或 Bitmap 提供圖片。
.FacebookPhoto.titleString?選填的說明/標題。
.FacebookPhoto.imageURIUri?要分享的相片,以 content Uri(android.net.Uri)表示: 主要建構式。
.FacebookPhoto.bitmapBitmap?要分享的相片,以 Bitmap(android.graphics.Bitmap)表示: 替代建構式。會在內部轉換為 Uri。
.FacebookLinkShareType.FacebookLink分享連結到 Facebook。
.FacebookLink.titleString?連結標題。
.FacebookLink.descriptionString?連結說明。
.FacebookLink.redirectLinkString?要分享的 URL。
.FacebookLink.imageURLString?選填的預覽圖片 URL。
.InstagramPhotoFeedShareType.InstagramPhotoFeed分享圖片到 Instagram 動態。
.InstagramPhotoFeed.imageURIUri?要分享的圖片(android.net.Uri)。
.InstagramPhotoStoryShareType.InstagramPhotoStory分享圖片到 Instagram 限時動態。
.InstagramPhotoStory.imageURIUri?要分享的圖片(android.net.Uri)。
字段类型描述
.FacebookPhotoShareType.FacebookPhoto分享照片到 Facebook: 以 Uri 或 Bitmap 提供图片。
.FacebookPhoto.titleString?可选的说明/标题。
.FacebookPhoto.imageURIUri?要分享的照片,以 content Uri(android.net.Uri)表示: 主构造函数。
.FacebookPhoto.bitmapBitmap?要分享的照片,以 Bitmap(android.graphics.Bitmap)表示: 备用构造函数。会在内部转换为 Uri。
.FacebookLinkShareType.FacebookLink分享链接到 Facebook。
.FacebookLink.titleString?链接标题。
.FacebookLink.descriptionString?链接描述。
.FacebookLink.redirectLinkString?要分享的 URL。
.FacebookLink.imageURLString?可选的预览图片 URL。
.InstagramPhotoFeedShareType.InstagramPhotoFeed分享图片到 Instagram 动态。
.InstagramPhotoFeed.imageURIUri?要分享的图片(android.net.Uri)。
.InstagramPhotoStoryShareType.InstagramPhotoStory分享图片到 Instagram 快拍。
.InstagramPhotoStory.imageURIUri?要分享的图片(android.net.Uri)。

VGSDKAgeSignal

The result of Request age signals. Every outcome arrives in this one shape, including the ones that never reached the store, so your game writes a single handling branch.

請求年齡訊號 的結果。每一種結果都會以這一種結構回傳,包含那些根本沒有連上商店的情況,因此你的遊戲只需要寫一套處理分支。

请求年龄信号 的结果。每一种结果都会以这一种结构返回,包含那些根本没有连上商店的情况,因此你的游戏只需要写一套处理分支。

Fields

欄位

字段

FieldTypeDescription
accessVGSDKAgeAccessWhether a band is available, and if not, what stands in the way. Full set: VGSDKAgeAccess.
reasonVGSDKAgeReasonThe unified cause, carrying the same value on every platform for the same underlying cause. Full set: VGSDKAgeReason.
rangeVGSDKAgeRange?The age band, present only on a shared outcome and absent otherwise. Full model: VGSDKAgeRange.
sourceVGSDKAgeSourceHow the age was established, plus the store’s own untranslated value. Full model: VGSDKAgeSource.
errorVGSDKAgeError?Present only on a failing outcome, and absent on every other. Carries the number the player was shown.
error.codeIntThe SDK error code the dialog showed the player, either 9051 or 9052. Report it in a support ticket rather than branching on it, since reason carries the cause at full resolution.
error.messageString?Diagnostic text for your logs. Do not show it to players and do not match on it.
欄位型別說明
accessVGSDKAgeAccess是否能取得年齡區間,若不能,是什麼原因擋住了。完整集合:VGSDKAgeAccess。
reasonVGSDKAgeReason統一的原因,同一個底層原因在每個平台上都帶同一個值。完整集合:VGSDKAgeReason。
rangeVGSDKAgeRange?年齡區間,只有在成功取得區間的結果上才會存在,其餘情況一律不存在。完整模型:VGSDKAgeRange。
sourceVGSDKAgeSource年齡是如何確立的,以及商店自己未經轉換的值。完整模型:VGSDKAgeSource。
errorVGSDKAgeError?只有在失敗的結果上才會存在,其餘情況一律不存在。帶有玩家看到的那個號碼。
error.codeInt對話框顯示給玩家的 SDK 錯誤碼,為 9051 或 9052。請把它放進客服單,而不要拿它來分支,因為完整的原因在 reason 裡。
error.messageString?供你記錄用的診斷文字。請不要顯示給玩家,也不要用它做字串比對。
字段类型描述
accessVGSDKAgeAccess是否能取得年龄区间,若不能,是什么原因挡住了。完整集合:VGSDKAgeAccess。
reasonVGSDKAgeReason统一的原因,同一个底层原因在每个平台上都带同一个值。完整集合:VGSDKAgeReason。
rangeVGSDKAgeRange?年龄区间,只有在成功取得区间的结果上才会存在,其余情况一律不存在。完整模型:VGSDKAgeRange。
sourceVGSDKAgeSource年龄是如何确立的,以及商店自己未经转换的值。完整模型:VGSDKAgeSource。
errorVGSDKAgeError?只有在失败的结果上才会存在,其余情况一律不存在。带有玩家看到的那个号码。
error.codeInt对话框显示给玩家的 SDK 错误码,为 9051 或 9052。请把它放进客服单,而不要拿它来分支,因为完整的原因在 reason 里。
error.messageString?供你记录用的诊断文本。请不要显示给玩家,也不要用它做字符串匹配。

VGSDKAgeAccess

Whether an age band is available, and the first thing to branch on. Field = the case as this platform spells it, Type = the wire value the contract fixes. Any row whose Type is a language type is a property rather than a case.

是否能取得年齡區間,以及第一個該用來分支的值。Field 為該平台拼寫的列舉項目,Type 為契約固定的 wire 值。Type 欄位若是語言型別,該列就是屬性而不是列舉項目。

是否能取得年龄区间,以及第一个该用来分支的值。Field 为该平台拼写的枚举项,Type 为契约固定的 wire 值。Type 列若是语言类型,该行就是属性而不是枚举项。

Fields

欄位

字段

FieldTypeDescription
SHAREDsharedA band is available and range is populated.
NOT_SHAREDnot_sharedNo band is available. reason carries the cause and range is absent.
VERIFICATION_REQUIREDverification_requiredThe player has to verify their age outside your game before any band exists. Only Google Play answers this today. It is defined on both platforms so your branch does not change if the App Store starts answering it.
UNAVAILABLEunavailableNo signal could be obtained at all, whether the SDK never called the store or the store refused.
UNKNOWNunknownThe store answered with a value this SDK version does not recognise.
wireStringAccessor: the wire value this case carries, which is the string in the Type column. It is the only accessor for that value, so logging or serializing a result goes through it.
fromWire(value)VGSDKAgeAccessAccessor: the case a wire value maps back to. An unrecognised or absent value answers UNKNOWN rather than throwing, so a store value minted after your build still lands on a defined case.
欄位型別說明
SHAREDshared可取得年齡區間,且 range 有值。
NOT_SHAREDnot_shared無法取得年齡區間。reason 帶有原因,而 range 不存在。
VERIFICATION_REQUIREDverification_required玩家必須先在你的遊戲之外驗證年齡,才會有任何區間。目前只有 Google Play 會這樣回覆。兩個平台上都有定義,因此即使日後 App Store 也開始這樣回覆,你的分支也不用改。
UNAVAILABLEunavailable完全無法取得訊號,無論是 SDK 根本沒有呼叫商店,或是商店拒絕了。
UNKNOWNunknown商店回覆了這個 SDK 版本不認得的值。
wireString存取子:這個項目所帶的 wire 值,也就是 Type 欄位裡的字串。它是取得該值的唯一管道,因此要記錄或序列化結果都得經過它。
fromWire(value)VGSDKAgeAccess存取子:一個 wire 值會對應回哪一個項目。不認得或不存在的值會回答 UNKNOWN 而不會拋出例外,因此在你的版本之後才出現的商店值仍然會落在一個已定義的項目上。
字段类型描述
SHAREDshared可取得年龄区间,且 range 有值。
NOT_SHAREDnot_shared无法取得年龄区间。reason 带有原因,而 range 不存在。
VERIFICATION_REQUIREDverification_required玩家必须先在你的游戏之外验证年龄,才会有任何区间。目前只有 Google Play 会这样回复。两个平台上都有定义,因此即使日后 App Store 也开始这样回复,你的分支也不用改。
UNAVAILABLEunavailable完全无法取得信号,无论是 SDK 根本没有调用商店,或是商店拒绝了。
UNKNOWNunknown商店回复了这个 SDK 版本不认识的值。
wireString访问器:这个项目所带的 wire 值,也就是 Type 列里的字符串。它是取得该值的唯一途径,因此要记录或序列化结果都得经过它。
fromWire(value)VGSDKAgeAccess访问器:一个 wire 值会对应回哪一个项目。不认识或不存在的值会回答 UNKNOWN 而不会抛出异常,因此在你的版本之后才出现的商店值仍然会落在一个已定义的项目上。

VGSDKAgeReason

The unified cause behind access, carrying the same value on every platform for the same underlying cause even where the two stores report it differently. Every case is defined on both platforms, so your branch is exhaustive everywhere. A note naming a platform is a restriction on where the case is actually PRODUCED in this release, and a case carrying no such note is produced on both. Field = the case as this platform spells it, Type = the wire value the contract fixes. Any row whose Type is a language type is a property rather than a case.

access 背後的統一原因。即使兩家商店的回報方式不同,同一個底層原因在每個平台上都會帶同一個值。每個項目在兩個平台上都有定義,因此你的分支在哪裡都是窮盡的。註記裡若提到平台,代表這個版本只有該平台會實際產生它,沒有這種註記的項目則兩個平台都會產生。Field 為該平台拼寫的列舉項目,Type 為契約固定的 wire 值。Type 欄位若是語言型別,該列就是屬性而不是列舉項目。

access 背后的统一原因。即使两家商店的报告方式不同,同一个底层原因在每个平台上都会带同一个值。每个项在两个平台上都有定义,因此你的分支在哪里都是穷尽的。注记里若提到平台,代表这个版本只有该平台会实际产生它,没有这种注记的项则两个平台都会产生。Field 为该平台拼写的枚举项,Type 为契约固定的 wire 值。Type 列若是语言类型,该行就是属性而不是枚举项。

Fields

欄位

字段

FieldTypeDescription
OKokA band was returned, so access is the shared case.
DISABLED_BY_CONFIGdisabled_by_configThe feature is switched off for your game, so the store was never called. Ask VNGGames to enable it.
NO_AGE_SIGNALno_age_signalNo band, and the store did not separate the cause any further. This is never reported as a refusal, because on this path the SDK cannot evidence one.
DECLINED_BY_USERdeclined_by_userThe store reported an explicit refusal as its own distinct answer. Neither platform produces it in this release, and an App Store refusal arrives as no_age_signal instead.
ACCOUNT_NOT_ELIGIBLEaccount_not_eligibleThe store account cannot carry an age signal. Neither platform produces it in this release.
VERIFICATION_REQUIREDverification_requiredThe player must verify outside your game first. Only Google Play reports this today.
DEVICE_NOT_ELIGIBLEdevice_not_eligibleThe running operating system, store application or store services cannot serve the call. This also covers a device below the minimum version this platform requires, where the SDK answers without calling the store.
APP_NOT_ELIGIBLEapp_not_eligibleThis application cannot use the mechanism. Only Google Play reports this today, and there it means the store did not install the build.
INVALID_REQUESTinvalid_requestThe store rejected the request itself. Only the App Store reports this today.
STORE_UNREACHABLEstore_unreachableThe store could not be reached. The SDK already retried before answering. Worth calling again in a later session.
TRANSIENT_ERRORtransient_errorA temporary failure on the device. Only Google Play reports this today. The SDK already retried before answering. Worth calling again in a later session.
SDK_OUTDATEDsdk_outdatedThe store no longer supports the client library in this build. Only Google Play reports this today.
INTERNAL_ERRORinternal_errorA failure the SDK could not classify. The store’s own code is in the SDK log. On iOS it is also where every store error the SDK does not map lands.
UNKNOWNunknownThe store answered with a value this SDK version does not define.
wireStringAccessor: the wire value this case carries, which is the string in the Type column. It is the only accessor for that value, so logging or serializing a result goes through it.
fromWire(value)VGSDKAgeReasonAccessor: the case a wire value maps back to. An unrecognised or absent value answers UNKNOWN rather than throwing, so a store value minted after your build still lands on a defined case.
欄位型別說明
OKok已回傳年齡區間,因此 access 落在代表「已分享」的那一項。
DISABLED_BY_CONFIGdisabled_by_config此功能在你的遊戲上未開啟,因此根本沒有呼叫商店。請向 VNGGames 申請啟用。
NO_AGE_SIGNALno_age_signal沒有年齡區間,而商店也沒有進一步區分原因。這永遠不會被回報為拒絕,因為在這條路徑上 SDK 無法佐證有拒絕發生。
DECLINED_BY_USERdeclined_by_user商店以獨立的回覆明確表示拒絕。這個版本的兩個平台都不會產生它,App Store 的拒絕會改以 no_age_signal 送達。
ACCOUNT_NOT_ELIGIBLEaccount_not_eligible該商店帳號無法帶有年齡訊號。這個版本的兩個平台都不會產生它。
VERIFICATION_REQUIREDverification_required玩家必須先在你的遊戲之外完成驗證。目前只有 Google Play 會回報這一項。
DEVICE_NOT_ELIGIBLEdevice_not_eligible執行中的作業系統、商店應用程式或商店服務無法處理這個呼叫。低於本平台所需最低版本的裝置也屬於這一項,此時 SDK 不會呼叫商店就直接作答。
APP_NOT_ELIGIBLEapp_not_eligible這個應用程式無法使用該機制。目前只有 Google Play 會回報這一項,在那裡它代表這個版本不是由商店安裝的。
INVALID_REQUESTinvalid_request商店拒絕了請求本身。目前只有 App Store 會回報這一項。
STORE_UNREACHABLEstore_unreachable無法連上商店。SDK 在作答前已經重試過。值得在之後的工作階段再呼叫一次。
TRANSIENT_ERRORtransient_error裝置上的暫時性失敗。目前只有 Google Play 會回報這一項。SDK 在作答前已經重試過。值得在之後的工作階段再呼叫一次。
SDK_OUTDATEDsdk_outdated商店已不再支援這個版本所帶的用戶端函式庫。目前只有 Google Play 會回報這一項。
INTERNAL_ERRORinternal_errorSDK 無法歸類的失敗。商店自己的代碼會記錄在 SDK 日誌裡。在 iOS 上,SDK 沒有對應到的商店錯誤也全都落在這一項。
UNKNOWNunknown商店回覆了這個 SDK 版本沒有定義的值。
wireString存取子:這個項目所帶的 wire 值,也就是 Type 欄位裡的字串。它是取得該值的唯一管道,因此要記錄或序列化結果都得經過它。
fromWire(value)VGSDKAgeReason存取子:一個 wire 值會對應回哪一個項目。不認得或不存在的值會回答 UNKNOWN 而不會拋出例外,因此在你的版本之後才出現的商店值仍然會落在一個已定義的項目上。
字段类型描述
OKok已返回年龄区间,因此 access 落在代表「已分享」的那一项。
DISABLED_BY_CONFIGdisabled_by_config此功能在你的游戏上未开启,因此根本没有调用商店。请向 VNGGames 申请启用。
NO_AGE_SIGNALno_age_signal没有年龄区间,而商店也没有进一步区分原因。这永远不会被报告为拒绝,因为在这条路径上 SDK 无法佐证有拒绝发生。
DECLINED_BY_USERdeclined_by_user商店以独立的回复明确表示拒绝。这个版本的两个平台都不会产生它,App Store 的拒绝会改以 no_age_signal 送达。
ACCOUNT_NOT_ELIGIBLEaccount_not_eligible该商店账号无法带有年龄信号。这个版本的两个平台都不会产生它。
VERIFICATION_REQUIREDverification_required玩家必须先在你的游戏之外完成验证。目前只有 Google Play 会报告这一项。
DEVICE_NOT_ELIGIBLEdevice_not_eligible运行中的操作系统、商店应用或商店服务无法处理这个调用。低于本平台所需最低版本的设备也属于这一项,此时 SDK 不会调用商店就直接作答。
APP_NOT_ELIGIBLEapp_not_eligible这个应用无法使用该机制。目前只有 Google Play 会报告这一项,在那里它代表这个版本不是由商店安装的。
INVALID_REQUESTinvalid_request商店拒绝了请求本身。目前只有 App Store 会报告这一项。
STORE_UNREACHABLEstore_unreachable无法连上商店。SDK 在作答前已经重试过。值得在之后的会话中再调用一次。
TRANSIENT_ERRORtransient_error设备上的暂时性失败。目前只有 Google Play 会报告这一项。SDK 在作答前已经重试过。值得在之后的会话中再调用一次。
SDK_OUTDATEDsdk_outdated商店已不再支持这个版本所带的客户端库。目前只有 Google Play 会报告这一项。
INTERNAL_ERRORinternal_errorSDK 无法归类的失败。商店自己的代码会记录在 SDK 日志里。在 iOS 上,SDK 没有对应到的商店错误也全都落在这一项。
UNKNOWNunknown商店回复了这个 SDK 版本没有定义的值。
wireString访问器:这个项目所带的 wire 值,也就是 Type 列里的字符串。它是取得该值的唯一途径,因此要记录或序列化结果都得经过它。
fromWire(value)VGSDKAgeReason访问器:一个 wire 值会对应回哪一个项目。不认识或不存在的值会回答 UNKNOWN 而不会抛出异常,因此在你的版本之后才出现的商店值仍然会落在一个已定义的项目上。

VGSDKAgeRange

The age band, present only on a shared outcome. In a region whose law sets its own bands the store may answer with those instead, and the SDK reports them exactly as given without adjusting them or treating them as an error.

年齡區間,只有在成功取得區間的結果上才會存在。在法律自訂年齡分級的地區,商店可能會回覆該地區的區間,SDK 會原封不動地回報,不會調整,也不會當成錯誤。

年龄区间,只有在成功取得区间的结果上才会存在。在法律自定年龄分级的地区,商店可能会返回该地区的区间,SDK 会原样报告,不会调整,也不会当成错误。

Fields

欄位

字段

FieldTypeDescription
lowerInt?Lower bound of the band, in years. Absent when the store supplied no lower bound. Check for its presence rather than comparing against a sentinel, because the SDK never stands an absent bound in with a number.
upperInt?Upper bound of the band, in years. Absent when the player is at or above the highest threshold, which is a successful result and not a failure. An absent upper bound is how an open ended band is expressed, and there is no separate flag for it.
欄位型別說明
lowerInt?區間下限,以歲為單位。當商店沒有提供下限時不存在。請檢查它是否存在,而不要拿它跟某個特殊數值比較,因為 SDK 絕不會用數字來代替不存在的界限。
upperInt?區間上限,以歲為單位。當玩家達到或超過最高門檻時不存在,這是成功的結果,不是失敗。沒有上限就是用來表達這個區間沒有封頂,SDK 不會另外提供一個旗標。
字段类型描述
lowerInt?区间下限,以岁为单位。当商店没有提供下限时不存在。请检查它是否存在,而不要拿它跟某个特殊数值比较,因为 SDK 绝不会用数字来代替不存在的界限。
upperInt?区间上限,以岁为单位。当玩家达到或超过最高阈值时不存在,这是成功的结果,不是失败。没有上限就是用来表达这个区间没有封顶,SDK 不会另外提供一个标志位。

VGSDKAgeSource

How the age behind a band was established.

年齡區間背後的年齡是如何確立的。

年龄区间背后的年龄是如何确立的。

Fields

欄位

字段

FieldTypeDescription
assuranceVGSDKAgeAssuranceHow firmly the age was established, on an ordered scale you can compare against your own minimum. Full set: VGSDKAgeAssurance.
setByVGSDKAgeSetByWho set the age, where the store says so.
• SELF the player set it.
• GUARDIAN a parent or guardian set it.
• UNKNOWN the store did not say. It is never guessed from the assurance level.
rawValueString?The store’s own value, carried unchanged so a value this SDK version does not recognise still reaches you. Diagnostic only. Your game never has to read it and must not branch on it.
欄位型別說明
assuranceVGSDKAgeAssurance年齡確立的可信程度,採用可排序的等級,方便你和自己的最低要求比較。完整集合:VGSDKAgeAssurance。
setByVGSDKAgeSetBy在商店有說明的情況下,是誰設定了年齡。
• SELF 由玩家自己設定。
• GUARDIAN 由家長或監護人設定。
• UNKNOWN 商店沒有說明。它絕不會從可信等級去推測。
rawValueString?商店自己的值,原封不動地帶過來,讓這個 SDK 版本不認得的值也仍然能傳到你手上。僅供診斷。你的遊戲不需要讀它,也不該拿它來分支。
字段类型描述
assuranceVGSDKAgeAssurance年龄确立的可信程度,采用可排序的等级,方便你和自己的最低要求比较。完整集合:VGSDKAgeAssurance。
setByVGSDKAgeSetBy在商店有说明的情况下,是谁设置了年龄。
• SELF 由玩家自己设置。
• GUARDIAN 由家长或监护人设置。
• UNKNOWN 商店没有说明。它绝不会从可信等级去推测。
rawValueString?商店自己的值,原样带过来,让这个 SDK 版本不认识的值也仍然能传到你手上。仅供诊断。你的游戏不需要读它,也不该拿它来分支。

VGSDKAgeAssurance

How firmly the age was established, ordered so you can compare a result against your own minimum. The unknown level ranks below every named one. The SDK never promotes or demotes a store value into a level the store did not express. Field = the case as this platform spells it, Type = the wire value the contract fixes. Any row whose Type is a language type is a property rather than a case.

年齡確立的可信程度,已排序,方便你拿結果和自己的最低要求比較。代表「不明」的等級排在所有具名等級之下。SDK 不會把商店的值升級或降級成商店未表達的等級。Field 為該平台拼寫的列舉項目,Type 為契約固定的 wire 值。Type 欄位若是語言型別,該列就是屬性而不是列舉項目。

年龄确立的可信程度,已排序,方便你拿结果和自己的最低要求比较。代表「不明」的等级排在所有具名等级之下。SDK 不会把商店的值升级或降级成商店未表达的等级。Field 为该平台拼写的枚举项,Type 为契约固定的 wire 值。Type 列若是语言类型,该行就是属性而不是枚举项。

Fields

欄位

字段

FieldTypeDescription
UNKNOWNunknownThe store gave no value, or gave one this SDK version does not recognise. rawValue still carries whatever it said.
SELF_DECLAREDself_declaredThe player declared the age themselves.
GUARDIANguardianA parent or guardian declared or manages the age.
VERIFIED_INDIRECTverified_indirectThe age was checked by some means such as a payment method, an email, a selfie or an identity document.
VERIFIED_STRONGverified_strongThe strongest level, from a government identity document with a selfie or a digital ID. Only the Google Play tier scale reaches it. The App Store has no equivalent, so an answer from it never carries this level.
wireStringAccessor: the wire value this case carries, which is the string in the Type column. It is the only accessor for that value, so logging or serializing a result goes through it.
fromWire(value)VGSDKAgeAssuranceAccessor: the case a wire value maps back to. An unrecognised or absent value answers UNKNOWN rather than throwing, so a store value minted after your build still lands on a defined case.
欄位型別說明
UNKNOWNunknown商店沒有給值,或給了這個 SDK 版本不認得的值。rawValue 仍然帶有它所說的內容。
SELF_DECLAREDself_declared由玩家自己宣告年齡。
GUARDIANguardian由家長或監護人宣告或管理年齡。
VERIFIED_INDIRECTverified_indirect年齡已透過某種方式查核,例如付款方式、電子郵件、自拍或身分證件。
VERIFIED_STRONGverified_strong最強的等級,來自政府核發的身分證件加上自拍,或數位身分。只有 Google Play 的等級量表會到達這一級。App Store 沒有對應的等級,因此來自它的回覆永遠不會帶有這一級。
wireString存取子:這個項目所帶的 wire 值,也就是 Type 欄位裡的字串。它是取得該值的唯一管道,因此要記錄或序列化結果都得經過它。
fromWire(value)VGSDKAgeAssurance存取子:一個 wire 值會對應回哪一個項目。不認得或不存在的值會回答 UNKNOWN 而不會拋出例外,因此在你的版本之後才出現的商店值仍然會落在一個已定義的項目上。
字段类型描述
UNKNOWNunknown商店没有给值,或给了这个 SDK 版本不认识的值。rawValue 仍然带有它所说的内容。
SELF_DECLAREDself_declared由玩家自己声明年龄。
GUARDIANguardian由家长或监护人声明或管理年龄。
VERIFIED_INDIRECTverified_indirect年龄已通过某种方式核查,例如支付方式、电子邮件、自拍或身份证件。
VERIFIED_STRONGverified_strong最强的等级,来自政府核发的身份证件加上自拍,或数字身份。只有 Google Play 的等级量表会到达这一级。App Store 没有对应的等级,因此来自它的回复永远不会带有这一级。
wireString访问器:这个项目所带的 wire 值,也就是 Type 列里的字符串。它是取得该值的唯一途径,因此要记录或序列化结果都得经过它。
fromWire(value)VGSDKAgeAssurance访问器:一个 wire 值会对应回哪一个项目。不认识或不存在的值会回答 UNKNOWN 而不会抛出异常,因此在你的版本之后才出现的商店值仍然会落在一个已定义的项目上。

VGSDKAgeSignalsListener

The listener you hand to Request age signals, and the type your game implements. It is a plain interface rather than a fun interface, so Kotlin will not convert a lambda into one: pass an object : VGSDKAgeSignalsListener instead. Java converts a lambda to it normally, which is why the two code tabs differ.

你交給 請求年齡訊號 的監聽器,也是你的遊戲要實作的型別。它是一般的 interface 而不是 fun interface,因此 Kotlin 不會把 lambda 轉換成它,請改傳 object : VGSDKAgeSignalsListener。Java 則可以正常把 lambda 轉換過去,這就是兩個程式碼分頁不一樣的原因。

你交给 请求年龄信号 的监听器,也是你的游戏要实现的类型。它是普通的 interface 而不是 fun interface,因此 Kotlin 不会把 lambda 转换成它,请改传 object : VGSDKAgeSignalsListener。Java 则可以正常把 lambda 转换过去,这就是两个代码分页不一样的原因。

Fields

欄位

字段

FieldTypeDescription
onResult(signal)VGSDKAgeSignalCalled exactly once per request, on the main thread, on every branch. There is no error callback, because a failure arrives inside the signal.
欄位型別說明
onResult(signal)VGSDKAgeSignal每一次請求都只會在主執行緒上被呼叫一次,而且每一條分支都會呼叫。沒有獨立的錯誤 callback,因為失敗是裝在訊號裡送達的。
字段类型描述
onResult(signal)VGSDKAgeSignal每一次请求都只会在主线程上被调用一次,而且每一条分支都会调用。没有独立的错误 callback,因为失败是装在信号里送达的。

Error Codes

Failures arrive as an error on domain net.vnggames.sdk (PassError), banded by source. Each row is one code: Field = numeric error.code, Type = the symbol. Note: for the mapped auth/payment bands the SDK band number is shown in the message while error.code preserves the upstream server value.

失敗會以網域 net.vnggames.sdk 上的錯誤(PassError)傳回,並依來源分段。每一列代表一個錯誤碼: Field=數值 error.code,Type=該符號。注意:對於已對應的驗證/付款分段,訊息中會顯示 SDK 分段編號,而 error.code 則保留上游伺服器的值。

失败以域为 net.vnggames.sdk(PassError)的错误形式返回,按来源分段。每一行是一个错误码: Field = 数值 error.code,Type = 符号。注意:对于经过映射的验证 / 支付段,消息中显示的是 SDK 段号,而 error.code 保留上游服务器的原始值。

Auth: VGA / OAuth (7xxx)

VGA (VNGGames Account) / OAuth login errors, delivered as an error. These back the VGA login flows. iOS/Android differ: both share the 7005 to 7020 OAuth codes, but elsewhere the endpoints diverge: on Android user-cancel is 7002 (USER_CANCEL, the legacy build flavor reports 9003 on its cancel-login path), 7003 is LOGIN_FAILED, and 7021 is account-already-bound (QUICK_LOGIN_ACCOUNT_BOUND). iOS instead uses 7001 for cancel and 7021 for validateAccessTokenNullResult, and defines 7022 至 7027 (null-result and quick-login cases) that Android does not.

VGA(VNGGames Account)/OAuth 登入錯誤,以錯誤傳回。這些支撐 VGA 登入流程。iOS 與 Android 有差異:兩者共用 7005 至 7020 的 OAuth 代碼,但其他端點有所分歧: 在 Android 上,玩家取消為 7002(USER_CANCEL,legacy 建置風味在其取消登入路徑回報 9003),7003 為 LOGIN_FAILED,而 7021 為帳號已綁定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 則以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,並定義了 Android 沒有的 7022 至 7027(未傳回結果與快速登入的情形)。

VGA(VNGGames Account)/ OAuth 登录错误,以错误形式返回。它们支撑 VGA 登录流程。iOS 与 Android 存在差异:两者共用 7005 至 7020 的 OAuth 代码,但其他端点有所分歧: 在 Android 上,玩家取消为 7002(USER_CANCEL,legacy 构建风味在其取消登录路径返回 9003),7003 为 LOGIN_FAILED,而 7021 为账号已绑定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 则以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,并定义了 Android 没有的 7022 至 7027(未返回结果与快速登录的情形)。

Codes

錯誤碼

错误码

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, raised when the SDK verifies the receipt. Type = the source payment server code. Which number reaches your callback differs by platform: on Android it is the 6xxx value, carried inside the message text as [6002] to [6006], while on iOS NSError.code is the server’s RAW code (-8, -70, -71, -72, -73) and the 6xxx appears only inside the message, so branch on the raw code there. A successful verification is not an error and is never reported through this band.

帳務伺服器錯誤,在 SDK 驗證收據時引發。Type=來源付款伺服器碼。實際傳到你回呼的是哪個數字會因平台而異: 在 Android 上就是 6xxx 這個值,以 [6002] 到 [6006] 的形式出現在訊息文字裡。在 iOS 上 NSError.code 是伺服器的原始碼(-8、-70、-71、-72、-73),6xxx 只會出現在訊息裡,所以在 iOS 上請用原始碼做分支。驗證成功不是錯誤,永遠不會透過這個分段回報。

计费服务器错误,在 SDK 验证收据时引发。Type = 来源支付服务器码。实际传到你回调的是哪个数字会因平台而异: 在 Android 上就是 6xxx 这个值,以 [6002] 到 [6006] 的形式出现在消息文字里。在 iOS 上 NSError.code 是服务器的原始码(-8、-70、-71、-72、-73),6xxx 只会出现在消息里,所以在 iOS 上请用原始码做分支。验证成功不是错误,永远不会通过这个段回报。

Codes

錯誤碼

错误码

FieldTypeDescription
6000unknownUnknown billing-server error (fallback), carrying the unmapped server code after a dash.
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未知的帳務伺服器錯誤(備用),並在連字號後帶上未對應的伺服器碼。
6002-8系統維護中(任何付款系統錯誤都對應到此)。
6003-70付款錯誤(未分類的 IAP 付款失敗)。
6004-71收據無效(簽章錯誤或 package/product/order 不符)。
6005-72重複的收據(已成功驗證過)。
6006-73收據已過期(超過 72 小時)。
字段类型描述
6000unknown未知的计费服务器错误(兜底),并在连字符后带上未映射的服务器码。
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).
9054paymentAdvancedCommerceSignatureMissingiOS: the create-order response carried no signed request, so the store screen was never opened. Raised by Purchase a declared item.
9055paymentAdvancedCommerceUnsupportedDeviceiOS: the device cannot run the Advanced Commerce flow, which needs iOS 15. Check Check device support before you offer the shop so a player never reaches this.
9056paymentAdvancedCommerceTransactionPendingiOS: an earlier Advanced Commerce purchase is paid but not yet verified, and it blocks every new one in this flow, including a different item. It clears when that transaction finishes, with no restart needed.
9057paymentAdvancedCommerceStoreRejectediOS: the store refused the signed request. The declared value or price did not match what the payment platform expected, or the request was no longer valid when the screen would have opened.
欄位型別說明
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: 購買正等待核准(延遲/需家長同意)。
9054paymentAdvancedCommerceSignatureMissingiOS:建立訂單的回應沒有帶簽章請求,因此商店畫面根本沒有開啟。由 購買自行宣告的道具 拋出。
9055paymentAdvancedCommerceUnsupportedDeviceiOS:這台裝置無法執行 Advanced Commerce 流程,它需要 iOS 15。請在開放商店之前先呼叫 檢查裝置支援狀態,讓玩家根本碰不到這一項。
9056paymentAdvancedCommerceTransactionPendingiOS:先前一筆 Advanced Commerce 購買已付款但尚未驗證,它會擋下這個流程裡每一筆新的購買,即使是不同道具也一樣。等那筆交易完成後就會解除,不需要重新啟動。
9057paymentAdvancedCommerceStoreRejectediOS:商店拒絕了這個簽章請求。宣告的內容或價格和付款平台預期的不一致,或是在畫面要開啟時該請求已經失效。
字段类型描述
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: 购买正在等待批准(延迟 / 需家长同意)。
9054paymentAdvancedCommerceSignatureMissingiOS:创建订单的响应没有带签名请求,因此商店界面根本没有打开。由 购买自行声明的道具 抛出。
9055paymentAdvancedCommerceUnsupportedDeviceiOS:这台设备无法运行 Advanced Commerce 流程,它需要 iOS 15。请在开放商店之前先调用 检查设备支持状态,让玩家根本碰不到这一项。
9056paymentAdvancedCommerceTransactionPendingiOS:先前一笔 Advanced Commerce 购买已付款但尚未验证,它会挡下这个流程里每一笔新的购买,即使是不同道具也一样。等那笔交易完成后就会解除,不需要重新启动。
9057paymentAdvancedCommerceStoreRejectediOS:商店拒绝了这个签名请求。声明的内容或价格和支付平台预期的不一致,或是在界面要打开时该请求已经失效。

Social (9xxx)

Facebook and Instagram profile / share / invite failures.

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

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

Codes

錯誤碼

错误码

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

General & availability (9xxx)

Cross-cutting client errors any flow can surface, plus feature-availability sentinels. Customer support surfaces an error with the string code invalid_payload. (Reserved/unused: 9004, and 9010 to 9015.)

任何流程都可能出現的橫切用戶端錯誤,以及功能可用性的哨符值。客戶支援會以字串碼 invalid_payload 呈現一個錯誤。(保留/未使用:9004、9010 至 9015)

任何流程都可能暴露的横切客户端错误,以及功能可用性哨兵值。客户支持会以字符串码 invalid_payload 暴露一个错误。(保留 / 未使用:9004、9010 至 9015)

Codes

錯誤碼

错误码

FieldTypeDescription
9000undefinedUndefined / unknown error.
9001networkFailedNetwork request failed (retryable).
9002wrongDataFormatMalformed response data.
9003cancelLoginLogin canceled (SDK band).
9005googleRefreshTokenFailedGoogle token refresh failed.
9018appleCredentialNotFoundInAuthorizationResultApple authorization returned no credential.
9019googleConfigNotFoundGoogle config missing.
9020facebookConfigNotFoundFacebook config missing.
9021appleTwoAuthenticationErrorSign in with Apple 2FA error.
9022appleCancelErrorPlayer canceled Sign in with Apple.
9023appleOtherErrorOther Sign in with Apple error.
9025appleCachedCredentialNotFoundNo cached Apple credential.
9036googleUnsupportedGoogle login not enabled in this build.
9037vgaUnsupportedVGA login not enabled in this build.
9047firebaseUnsupportedFirebase not enabled in this build.
9050recoverAccountUnavailableGuest account recovery could not be opened: the SDK could not read the recovery entry in the support configuration.
9051ageAssuranceUnavailable / AGE_SIGNALS_UNAVAILABLENo age signal could be obtained on a cause the store connection does not own. That is the feature being switched off, the operating system not carrying the mechanism, the store refusing, or a failure the SDK could not classify. Raised by Request age signals. Branch on the result’s reason, which separates those causes from each other.
9052ageAssuranceStoreUnreachable / AGE_SIGNALS_STORE_UNREACHABLEThe SDK reached the store for an age signal and every attempt failed on a connection or transient cause. Raised by Request age signals. This one is often gone by the next session, so a later call is worth making.
欄位型別說明
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。
9050recoverAccountUnavailable無法開啟訪客帳號尋回: SDK 無法讀取支援設定中的尋回項目。
9051ageAssuranceUnavailable / AGE_SIGNALS_UNAVAILABLE無法取得年齡訊號,原因不屬於商店連線本身。也就是功能未開啟、作業系統不具備該機制、商店拒絕,或是 SDK 無法歸類的失敗。由 請求年齡訊號 引發。請依結果中的 reason 分支,它會把這些原因彼此區分開來。
9052ageAssuranceStoreUnreachable / AGE_SIGNALS_STORE_UNREACHABLESDK 已連上商店索取年齡訊號,但每一次嘗試都因連線或暫時性原因而失敗。由 請求年齡訊號 引發。這種情況通常到了下個工作階段就會消失,值得再呼叫一次。
字段类型描述
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。
9050recoverAccountUnavailable无法打开访客账号寻回: SDK 无法读取支持配置中的寻回条目。
9051ageAssuranceUnavailable / AGE_SIGNALS_UNAVAILABLE无法取得年龄信号,原因不属于商店连接本身。也就是功能未开启、操作系统不具备该机制、商店拒绝,或是 SDK 无法归类的失败。由 请求年龄信号 引发。请按结果中的 reason 分支,它会把这些原因彼此区分开来。
9052ageAssuranceStoreUnreachable / AGE_SIGNALS_STORE_UNREACHABLESDK 已连上商店索取年龄信号,但每一次尝试都因连接或暂时性原因而失败。由 请求年龄信号 引发。这种情况通常到了下个会话就会消失,值得再调用一次。