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.jsonandgoogle-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 加入它们,因此你的构建只会取得你的游戏已启用的模块。请移除你自己对此处列出项目的声明,或将你的版本对齐此版本。
| Library | Version | Group |
|---|---|---|
com.squareup.retrofit2:retrofit | 2.9.0 | Core |
androidx.security:security-crypto | 1.0.0 | Core |
com.squareup.retrofit2:converter-gson | 2.9.0 | Core |
com.github.bumptech.glide:glide | 5.0.5 | Core |
androidx.browser:browser | 1.8.0 | Core |
com.squareup.okhttp3:okhttp | 4.10.0 | Core |
com.squareup.okhttp3:logging-interceptor | 4.10.0 | Core |
androidx.multidex:multidex | 2.0.0 | Core |
androidx.recyclerview:recyclerview | 1.0.0 | Core |
androidx.appcompat:appcompat | 1.2.0 | Core |
androidx.constraintlayout:constraintlayout | 1.1.3 | Core |
com.google.code.gson:gson | 2.13.2 | Core |
com.google.guava:guava | 27.0.1-android | Core |
androidx.lifecycle:lifecycle-extensions | 2.0.0 | Core |
androidx.lifecycle:lifecycle-compiler | 2.0.0 | Core |
com.google.android.material:material | 1.3.0 | Core |
androidx.databinding:viewbinding | 7.1.2 | Core |
androidx.core:core-ktx | 1.9.0 | Core |
androidx.activity:activity-ktx | 1.3.0 | Core |
androidx.fragment:fragment-ktx | 1.3.0 | Core |
org.jetbrains.kotlinx:kotlinx-coroutines-android | 1.5.2 | Core |
org.jetbrains.kotlinx:kotlinx-coroutines-core | 1.5.2 | Core |
org.jetbrains.kotlin:kotlin-reflect | 1.3.41 | Core |
androidx.lifecycle:lifecycle-process | 2.4.0 | Core |
androidx.work:work-runtime | 2.10.2 | Core |
androidx.work:work-runtime-ktx | 2.8.1 | Core |
io.grpc:grpc-okhttp | 1.32.2 | Core |
com.google.dagger:dagger | 2.22.1 | Core |
com.google.dagger:dagger-compiler | 2.22.1 | Core |
com.google.firebase:firebase-crashlytics | 20.0.5 | Core |
com.google.android.play:review | 2.0.0 | Core |
com.google.android.play:review-ktx | 2.0.0 | Core |
com.google.firebase:firebase-config | 23.0.1 | Core |
com.google.android.gms:play-services-gcm | 17.0.0 | Core |
androidx.datastore:datastore | 1.0.0 | Core |
com.google.crypto.tink:tink-android | 1.13.0 | Core |
androidx.room:room-ktx | 2.7.2 | Core |
androidx.room:room-runtime | 2.7.2 | Core |
androidx.room:room-compiler | 2.7.2 | Core |
io.github.centrifugal:centrifuge-java | 0.5.0 | Core |
androidx.viewpager2:viewpager2 | 1.1.0 | Core |
com.facebook.android:facebook-android-sdk | 18.1.3 | Login channels |
com.google.android.gms:play-services-auth | 20.4.0 | Login channels |
com.android.billingclient:billing | 7.1.1 | In-App Purchase |
com.appsflyer:af-android-sdk | 6.18.0 | Analytics |
com.android.installreferrer:installreferrer | 1.0 | Analytics |
com.google.firebase:firebase-analytics | 23.0.0 | Analytics |
cn.thinkingdata.android:ThinkingAnalyticsSDK | 3.4.0 | Analytics |
cn.thinkingdata.android:TDCore | 1.4.2 | Analytics |
com.facebook.android:facebook-android-sdk | 18.1.3 | Social |
com.unity3d.ads-mediation:mediation-sdk | 8.9.1 | In-App Ads |
com.unity3d.ads-mediation:adquality-sdk | 7.25.1 | In-App Ads |
com.facebook.android:audience-network-sdk | 6.20.0 | In-App Ads |
com.google.firebase:firebase-messaging | 25.0.1 | Engage |
com.google.firebase:firebase-inappmessaging-display | 22.0.3 | Engage |
com.clevertap.android:clevertap-android-sdk | 7.8.0 | Engage |
com.clevertap.android:push-templates | 2.1.0 | Engage |
| 函式庫 | 版本 | 分組 |
|---|---|---|
com.squareup.retrofit2:retrofit | 2.9.0 | 核心 |
androidx.security:security-crypto | 1.0.0 | 核心 |
com.squareup.retrofit2:converter-gson | 2.9.0 | 核心 |
com.github.bumptech.glide:glide | 5.0.5 | 核心 |
androidx.browser:browser | 1.8.0 | 核心 |
com.squareup.okhttp3:okhttp | 4.10.0 | 核心 |
com.squareup.okhttp3:logging-interceptor | 4.10.0 | 核心 |
androidx.multidex:multidex | 2.0.0 | 核心 |
androidx.recyclerview:recyclerview | 1.0.0 | 核心 |
androidx.appcompat:appcompat | 1.2.0 | 核心 |
androidx.constraintlayout:constraintlayout | 1.1.3 | 核心 |
com.google.code.gson:gson | 2.13.2 | 核心 |
com.google.guava:guava | 27.0.1-android | 核心 |
androidx.lifecycle:lifecycle-extensions | 2.0.0 | 核心 |
androidx.lifecycle:lifecycle-compiler | 2.0.0 | 核心 |
com.google.android.material:material | 1.3.0 | 核心 |
androidx.databinding:viewbinding | 7.1.2 | 核心 |
androidx.core:core-ktx | 1.9.0 | 核心 |
androidx.activity:activity-ktx | 1.3.0 | 核心 |
androidx.fragment:fragment-ktx | 1.3.0 | 核心 |
org.jetbrains.kotlinx:kotlinx-coroutines-android | 1.5.2 | 核心 |
org.jetbrains.kotlinx:kotlinx-coroutines-core | 1.5.2 | 核心 |
org.jetbrains.kotlin:kotlin-reflect | 1.3.41 | 核心 |
androidx.lifecycle:lifecycle-process | 2.4.0 | 核心 |
androidx.work:work-runtime | 2.10.2 | 核心 |
androidx.work:work-runtime-ktx | 2.8.1 | 核心 |
io.grpc:grpc-okhttp | 1.32.2 | 核心 |
com.google.dagger:dagger | 2.22.1 | 核心 |
com.google.dagger:dagger-compiler | 2.22.1 | 核心 |
com.google.firebase:firebase-crashlytics | 20.0.5 | 核心 |
com.google.android.play:review | 2.0.0 | 核心 |
com.google.android.play:review-ktx | 2.0.0 | 核心 |
com.google.firebase:firebase-config | 23.0.1 | 核心 |
com.google.android.gms:play-services-gcm | 17.0.0 | 核心 |
androidx.datastore:datastore | 1.0.0 | 核心 |
com.google.crypto.tink:tink-android | 1.13.0 | 核心 |
androidx.room:room-ktx | 2.7.2 | 核心 |
androidx.room:room-runtime | 2.7.2 | 核心 |
androidx.room:room-compiler | 2.7.2 | 核心 |
io.github.centrifugal:centrifuge-java | 0.5.0 | 核心 |
androidx.viewpager2:viewpager2 | 1.1.0 | 核心 |
com.facebook.android:facebook-android-sdk | 18.1.3 | 登入管道 |
com.google.android.gms:play-services-auth | 20.4.0 | 登入管道 |
com.android.billingclient:billing | 7.1.1 | 應用程式內購買 |
com.appsflyer:af-android-sdk | 6.18.0 | 分析 |
com.android.installreferrer:installreferrer | 1.0 | 分析 |
com.google.firebase:firebase-analytics | 23.0.0 | 分析 |
cn.thinkingdata.android:ThinkingAnalyticsSDK | 3.4.0 | 分析 |
cn.thinkingdata.android:TDCore | 1.4.2 | 分析 |
com.facebook.android:facebook-android-sdk | 18.1.3 | 社群 |
com.unity3d.ads-mediation:mediation-sdk | 8.9.1 | 應用程式內廣告 |
com.unity3d.ads-mediation:adquality-sdk | 7.25.1 | 應用程式內廣告 |
com.facebook.android:audience-network-sdk | 6.20.0 | 應用程式內廣告 |
com.google.firebase:firebase-messaging | 25.0.1 | Engage |
com.google.firebase:firebase-inappmessaging-display | 22.0.3 | Engage |
com.clevertap.android:clevertap-android-sdk | 7.8.0 | Engage |
com.clevertap.android:push-templates | 2.1.0 | Engage |
| 库 | 版本 | 分组 |
|---|---|---|
com.squareup.retrofit2:retrofit | 2.9.0 | 核心 |
androidx.security:security-crypto | 1.0.0 | 核心 |
com.squareup.retrofit2:converter-gson | 2.9.0 | 核心 |
com.github.bumptech.glide:glide | 5.0.5 | 核心 |
androidx.browser:browser | 1.8.0 | 核心 |
com.squareup.okhttp3:okhttp | 4.10.0 | 核心 |
com.squareup.okhttp3:logging-interceptor | 4.10.0 | 核心 |
androidx.multidex:multidex | 2.0.0 | 核心 |
androidx.recyclerview:recyclerview | 1.0.0 | 核心 |
androidx.appcompat:appcompat | 1.2.0 | 核心 |
androidx.constraintlayout:constraintlayout | 1.1.3 | 核心 |
com.google.code.gson:gson | 2.13.2 | 核心 |
com.google.guava:guava | 27.0.1-android | 核心 |
androidx.lifecycle:lifecycle-extensions | 2.0.0 | 核心 |
androidx.lifecycle:lifecycle-compiler | 2.0.0 | 核心 |
com.google.android.material:material | 1.3.0 | 核心 |
androidx.databinding:viewbinding | 7.1.2 | 核心 |
androidx.core:core-ktx | 1.9.0 | 核心 |
androidx.activity:activity-ktx | 1.3.0 | 核心 |
androidx.fragment:fragment-ktx | 1.3.0 | 核心 |
org.jetbrains.kotlinx:kotlinx-coroutines-android | 1.5.2 | 核心 |
org.jetbrains.kotlinx:kotlinx-coroutines-core | 1.5.2 | 核心 |
org.jetbrains.kotlin:kotlin-reflect | 1.3.41 | 核心 |
androidx.lifecycle:lifecycle-process | 2.4.0 | 核心 |
androidx.work:work-runtime | 2.10.2 | 核心 |
androidx.work:work-runtime-ktx | 2.8.1 | 核心 |
io.grpc:grpc-okhttp | 1.32.2 | 核心 |
com.google.dagger:dagger | 2.22.1 | 核心 |
com.google.dagger:dagger-compiler | 2.22.1 | 核心 |
com.google.firebase:firebase-crashlytics | 20.0.5 | 核心 |
com.google.android.play:review | 2.0.0 | 核心 |
com.google.android.play:review-ktx | 2.0.0 | 核心 |
com.google.firebase:firebase-config | 23.0.1 | 核心 |
com.google.android.gms:play-services-gcm | 17.0.0 | 核心 |
androidx.datastore:datastore | 1.0.0 | 核心 |
com.google.crypto.tink:tink-android | 1.13.0 | 核心 |
androidx.room:room-ktx | 2.7.2 | 核心 |
androidx.room:room-runtime | 2.7.2 | 核心 |
androidx.room:room-compiler | 2.7.2 | 核心 |
io.github.centrifugal:centrifuge-java | 0.5.0 | 核心 |
androidx.viewpager2:viewpager2 | 1.1.0 | 核心 |
com.facebook.android:facebook-android-sdk | 18.1.3 | 登录渠道 |
com.google.android.gms:play-services-auth | 20.4.0 | 登录渠道 |
com.android.billingclient:billing | 7.1.1 | 应用内购买 |
com.appsflyer:af-android-sdk | 6.18.0 | 分析 |
com.android.installreferrer:installreferrer | 1.0 | 分析 |
com.google.firebase:firebase-analytics | 23.0.0 | 分析 |
cn.thinkingdata.android:ThinkingAnalyticsSDK | 3.4.0 | 分析 |
cn.thinkingdata.android:TDCore | 1.4.2 | 分析 |
com.facebook.android:facebook-android-sdk | 18.1.3 | 社交 |
com.unity3d.ads-mediation:mediation-sdk | 8.9.1 | 应用内广告 |
com.unity3d.ads-mediation:adquality-sdk | 7.25.1 | 应用内广告 |
com.facebook.android:audience-network-sdk | 6.20.0 | 应用内广告 |
com.google.firebase:firebase-messaging | 25.0.1 | Engage |
com.google.firebase:firebase-inappmessaging-display | 22.0.3 | Engage |
com.clevertap.android:clevertap-android-sdk | 7.8.0 | Engage |
com.clevertap.android:push-templates | 2.1.0 | Engage |
Installation
Add configuration files
- Extract the VNGGames SDK zip file.
- From
[Demo Project]/[app module]/, copypass-services.jsonto[Game Project]/[app module]/. - From
[Demo Project]/app/, copygoogle-services.jsonto 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]/keystoreto[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
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userInfo | UserInfo | 已登入的玩家。欄位詳見 UserInfo。 |
error | Error? | 當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userInfo | UserInfo | 已登录的玩家。字段详见 UserInfo。 |
error | Error? | 当玩家取消或登录失败时存在: 请参阅 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
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userInfo | UserInfo | 已登入的玩家。欄位詳見 UserInfo。 |
error | Error? | 當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userInfo | UserInfo | 已登录的玩家。字段详见 UserInfo。 |
error | Error? | 当玩家取消或登录失败时存在: 请参阅 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
輸入
输入
| Field | Type | Description |
|---|---|---|
socialType | SocialType | Login channel to sign in to: see SocialType. |
| 欄位 | 型別 | 說明 |
|---|---|---|
socialType | SocialType | 要登入的登入頻道: 請參閱 SocialType。 |
| 字段 | 类型 | 描述 |
|---|---|---|
socialType | SocialType | 要登录的登录渠道: 请参阅 SocialType。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userInfo | UserInfo | 已登入的玩家。欄位詳見 UserInfo。 |
error | Error? | 當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userInfo | UserInfo | 已登录的玩家。字段详见 UserInfo。 |
error | Error? | 当玩家取消或登录失败时存在: 请参阅 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)。
Check the login session (server-side only)
Validates a player’s session from YOUR game server, not from the client. After a login callback hands the game a userID and a sessionID, the game’s backend POSTs them to /api/login/checkSession as application/x-www-form-urlencoded, and trusts the player only when returnCode is 1. There is no SDK call for this and no client-side equivalent: a client can claim any session, which is the reason the check exists. The domain to send it to and your game’s secret key are issued on request, see below.
從你的遊戲伺服器驗證玩家的工作階段,而不是從用戶端。登入回呼把 userID 與 sessionID 交給遊戲之後,遊戲的後端以 application/x-www-form-urlencoded 將兩者 POST 到 /api/login/checkSession,只有在 returnCode 為 1 時才信任該玩家。SDK 沒有對應的呼叫,用戶端也沒有等價做法:用戶端可以宣稱任何工作階段,這正是需要這道檢查的原因。要送往的網域與你的遊戲 secret key 需另行申請,見下方說明。
从你的游戏服务器验证玩家的会话,而不是从客户端。登录回调把 userID 与 sessionID 交给游戏之后,游戏的后端以 application/x-www-form-urlencoded 将两者 POST 到 /api/login/checkSession,只有在 returnCode 为 1 时才信任该玩家。SDK 没有对应的调用,客户端也没有等价做法:客户端可以声称任何会话,这正是需要这道检查的原因。要发往的域名与你的游戏 secret key 需另行申请,见下方说明。
# Domain and secret key come from your server's environment, never from a literal.
TIMESTAMP=$(date +%s)
SIG=$(printf '%s%s%s%s%s' "$VGA_SECRET_KEY" "$GAME_ID" "$USER_ID" "$TIMESTAMP" "$SESSION_ID" | md5sum | cut -d' ' -f1)
curl -X POST "$VGA_DOMAIN/api/login/checkSession" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "gameID=$GAME_ID" \
--data-urlencode "userID=$USER_ID" \
--data-urlencode "sessionID=$SESSION_ID" \
--data-urlencode "timestamp=$TIMESTAMP" \
--data-urlencode "sig=$SIG"Server-side only. The path is
/api/login/checkSession, but the DOMAIN and your game’s secret key are not published here. Email pin.sdk.dev@vng.com.vn to be issued both. The secret key must never ship in a game client.
僅限伺服器端。 路徑為
/api/login/checkSession,但網域與你的遊戲 secret key 不會公開在這裡,請來信 pin.sdk.dev@vng.com.vn 索取。secret key 絕對不可以隨遊戲用戶端一起發布。
仅限服务器端。 路径为
/api/login/checkSession,但域名与你的游戏 secret key 不会公开在这里,请来信 pin.sdk.dev@vng.com.vn 索取。secret key 绝对不可以随游戏客户端一起发布。
Input
輸入
输入
| Field | Type | Description |
|---|---|---|
userID | string | Unique VNGGames user id. |
sessionID | string | Session token used to authenticate backend calls. |
gameID | string | A VNGGames Account credential the SDK reads. |
timestamp | string | Unix time in SECONDS at the moment of the call. |
sig | string | Checksum over the other parameters: md5(secretKey + gameID + userID + timestamp + sessionID). The secret key is issued to your team and lives server-side only, which is what keeps this call off the client. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | string | VNGGames 唯一使用者 ID。 |
sessionID | string | 用於驗證後端呼叫的工作階段權杖。 |
gameID | string | SDK 會讀取的 VNGGames Account 憑證。 |
timestamp | string | 發出呼叫當下的 Unix 時間,單位為「秒」。 |
sig | string | 其餘參數的檢查碼:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 團隊發給你的團隊,且只存在於伺服器端,這正是這個呼叫不能放在用戶端的原因。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | string | VNGGames 唯一用户 ID。 |
sessionID | string | 用于验证后端调用的会话令牌。 |
gameID | string | SDK 会读取的 VNGGames Account 凭据。 |
timestamp | string | 发出调用当下的 Unix 时间,单位为「秒」。 |
sig | string | 其余参数的校验和:md5(secretKey + gameID + userID + timestamp + sessionID)。secret key 由 SDK 团队发给你的团队,且只存在于服务器端,这正是这个调用不能放在客户端的原因。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
returnCode | int | Treat anything other than 1 as not signed in.• 1 the session is valid.• -1 bad sig.• -2 bad parameter.• -108 the session does not exist.• -404 unknown endpoint.• -500 service error. |
message | string | Human-readable result, for your server logs rather than for players. |
data | null | Always null on this endpoint. The verdict is returnCode. |
| 欄位 | 型別 | 說明 |
|---|---|---|
returnCode | int | 只要不是 1,一律視為未登入。• 1 工作階段有效。• -1 sig 有誤。• -2 參數有誤。• -108 工作階段不存在。• -404 端點不存在。• -500 服務錯誤。 |
message | string | 可讀的結果訊息,用於你的伺服器紀錄,而不是顯示給玩家。 |
data | null | 這個端點永遠回傳 null,判定結果看 returnCode。 |
| 字段 | 类型 | 描述 |
|---|---|---|
returnCode | int | 只要不是 1,一律视为未登录。• 1 会话有效。• -1 sig 有误。• -2 参数有误。• -108 会话不存在。• -404 端点不存在。• -500 服务错误。 |
message | string | 可读的结果消息,用于你的服务器日志,而不是显示给玩家。 |
data | null | 这个端点永远返回 null,判定结果看 returnCode。 |
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
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA login error codes. |
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
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA login error codes. |
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
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA login error codes. |
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
輸出
输出
| Field | Type | Description |
|---|---|---|
userInfo | UserInfo | The signed-in player. Fields: UserInfo. |
error | Error? | The failure reason when the player cancels or login fails: see VGA login error codes. |
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
輸出
输出
| Field | Type | Description |
|---|---|---|
onBoundAccountSuccess | UserInfo | The signed-in player. Fields: UserInfo. |
onSwitchAccountSuccess | UserInfo | The signed-in player. Fields: UserInfo. |
onClose | : | Closed the screen without acting. |
In-App Purchase
Query the sellable products, then run a purchase through Google Play Billing / App Store In-App Purchase. Products and purchase status are delivered on listener closures.
查詢可販售的商品,然後透過 Google Play Billing/App Store In-App Purchase 執行購買。商品與購買狀態會透過監聽器閉包傳回。
先查询可售商品,然后通过 Google Play Billing / App Store In-App Purchase 执行购买。商品与购买状态在监听器闭包上返回。
Get products
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
輸入
输入
| Field | Type | Description |
|---|---|---|
items | List<String> | List of configured item id from Store. |
| 欄位 | 型別 | 說明 |
|---|---|---|
items | List<String> | 在商店設定的商品 id 清單。 |
| 字段 | 类型 | 描述 |
|---|---|---|
items | List<String> | 在商店配置的商品 id 列表。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
products | List<SkuDetails> | The products found. Empty when no id matched. Each entry: SkuDetails. |
| 欄位 | 型別 | 說明 |
|---|---|---|
products | List<SkuDetails> | 找到的商品。沒有 id 相符時為空。每個項目:SkuDetails。 |
| 字段 | 类型 | 描述 |
|---|---|---|
products | List<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
輸入
输入
| Field | Type | Description |
|---|---|---|
paymentInfo | PaymentInfo | The purchase request: full model: PaymentInfo. Optional clientKey / secretKey set signing keys. |
| 欄位 | 型別 | 說明 |
|---|---|---|
paymentInfo | PaymentInfo | 購買請求: 完整模型:PaymentInfo。選填的 clientKey / secretKey 用於設定簽章金鑰。 |
| 字段 | 类型 | 描述 |
|---|---|---|
paymentInfo | PaymentInfo | 购买请求: 完整模型:PaymentInfo。可选的 clientKey / secretKey 用于设置签名密钥。 |
Output
輸出
输出
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.
回報玩家是否有待發放的獎勵,讓遊戲決定要顯示或隱藏領取入口。
报告玩家是否有待发放的奖励,让游戏决定要显示或隐藏领取入口。
Run this before Verify reward: it only reports availability and grants nothing by itself.
請先執行此檢查,再呼叫「驗證獎勵」。它只回報是否有獎勵,本身不會發放任何內容。
请先执行此检查,再调用“验证奖励”。它只报告是否有奖励,本身不会发放任何内容。
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
輸入
输入
| Field | Type | Description |
|---|---|---|
listener | CheckHasRewardListener | Result listener for the check. |
| 欄位 | 型別 | 說明 |
|---|---|---|
listener | CheckHasRewardListener | 此次檢查的結果監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
listener | CheckHasRewardListener | 本次检查的结果监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (Boolean) -> Unit | Called with true when a reward is pending, false when there is none. |
onError | (String?) -> Unit | The 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.
發放待領取的獎勵,並回報該次失敗是否值得重試。
发放待领取的奖励,并报告该次失败是否值得重试。
Call this only after Check item reward reports a pending reward.
請僅在「檢查道具獎勵」回報有待發放的獎勵之後才呼叫。
请仅在“检查道具奖励”报告有待发放的奖励之后才调用。
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
輸入
输入
| Field | Type | Description |
|---|---|---|
rewardInfo | RewardInfo | The reward claim. All five fields are required. |
rewardInfo.userID | String? | Buyer’s VNGGames user id. |
rewardInfo.serverID | String | Game server id. |
rewardInfo.roleID | String | Character/role id. |
rewardInfo.appTransID | String | Your app-side transaction id, for reconciliation. |
rewardInfo.addInfo | String | Extra passthrough data. Empty string when unused. |
listener | VerifyRewardListener | Result listener for the grant. |
| 欄位 | 型別 | 說明 |
|---|---|---|
rewardInfo | RewardInfo | 獎勵領取請求。五個欄位皆為必填。 |
rewardInfo.userID | String? | 購買者的 VNGGames 使用者 ID。 |
rewardInfo.serverID | String | 伺服器 ID。 |
rewardInfo.roleID | String | 角色 ID。 |
rewardInfo.appTransID | String | 你的應用程式端交易 ID,用於對帳。 |
rewardInfo.addInfo | String | 額外的傳遞資料。未使用時請傳入空字串。 |
listener | VerifyRewardListener | 此次發放的結果監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
rewardInfo | RewardInfo | 奖励领取请求。五个字段均为必填。 |
rewardInfo.userID | String? | 购买者的 VNGGames 用户 ID。 |
rewardInfo.serverID | String | 服务器 ID。 |
rewardInfo.roleID | String | 角色 ID。 |
rewardInfo.appTransID | String | 你的应用端交易 ID,用于对账。 |
rewardInfo.addInfo | String | 额外的透传数据。未使用时请传入空字符串。 |
listener | VerifyRewardListener | 本次发放的结果监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onFinishSuccess | (String?) -> Unit | The reward was granted. |
onFinishFailToRetry | (String?) -> Unit | The grant failed transiently. Retrying the same request is safe. |
onFinishFailNonRetry | (String?) -> Unit | The 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 formulavgsdk_{prefix}_{event name}: for example,vgsdk_af_app_open. See Analytics platform prefixes.
涵蓋所有分析供應商的單一門面,依使用情境組織。請先設定分析,然後傳送臨時的自訂事件,或使用結構化的使用情境漏斗(Conversion Rate=應用程式啟動 → 遊玩、Onboarding=新使用者 → 早期營利、Main & Daily Activities、Social & Communities)。供應商:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每個呼叫都是 fire-and-forget。每個事件還會帶有一組由 SDK 自動填入的預設參數: 請參閱 分析預設參數。
注意: VNGGames SDK API 觸發的每個事件都以
vgsdk_前綴開頭,並遵循vgsdk_{prefix}_{event name}公式: 例如vgsdk_af_app_open。請參閱 分析平台前綴。
面向所有分析提供方的统一门面,按使用场景组织。先配置分析,然后发送临时自定义事件或结构化的使用场景漏斗(Conversion Rate = 应用启动 → 游玩,Onboarding = 新用户 → 早期变现,Main & Daily Activities,Social & Communities)。提供方:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每次调用都是 fire-and-forget。每个事件还会携带一组由 SDK 自动填充的默认参数: 请参阅 分析默认参数。
注意: VNGGames SDK API 触发的每个事件都以
vgsdk_前缀开头,并遵循公式vgsdk_{prefix}_{event name}: 例如vgsdk_af_app_open。请参阅 分析平台前缀。
Setup
Configure analytics
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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
roleName | String | Character/role name. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
roleName | String | 角色名稱。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
roleName | String | 角色名称。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Integration Limitations
Rules & limits
Constraints that apply to every event you send through this facade: they aggregate the rules of the underlying providers. Review them before instrumenting:
- Event names must begin with a letter, contain no spaces (use underscores), and be at most 100 characters. They may not begin with
",\,=,+, or-, are case-sensitive (af_purchase≠af_PURCHASE), and may include non-English characters. - Per event: at most 25 parameters.
- Parameter names must be at most 40 characters.
- Parameter values must not exceed 1000 characters (longer values may be truncated). Keep total event values under 2000 characters.
- Revenue / price values use digits and a single decimal point only, with at most 5 digits after the point.
- Cardinality: at most 300 unique event names per day.
- Unique users are counted only for the first 100 events after a user installs the app.
- Referring URLs must be URL-encoded.
- Meta (Facebook) Ads impose additional limits on event parameters.
適用於你透過此門面傳送的每個事件的限制: 它們彙整了底層各供應商的規則。請在埋點前詳閱:
- 事件名稱 必須以字母開頭、不得包含空格(請使用底線),且最多 100 個字元。不得以
"、\、=、+或-開頭,區分大小寫(af_purchase≠af_PURCHASE),並可包含非英文字元。 - 每個事件: 最多 25 個參數。
- 參數名稱 最多 40 個字元。
- 參數值 不得超過 1000 個字元(過長的值可能會被截斷)。請將事件的總值控制在 2000 個字元以內。
- 收益/價格值 僅能使用數字與單一小數點,小數點後最多 5 位數。
- 基數: 每天最多 300 個不重複的事件名稱。
- 不重複使用者 僅在使用者安裝應用程式後的前 100 個事件內計算。
- 來源 URL 必須經過 URL 編碼。
- Meta(Facebook)Ads 對事件參數施加額外限制。
适用于你通过此门面发送的每个事件的约束: 它们汇总了底层各提供方的规则。在埋点前请先阅读:
- 事件名称 必须以字母开头,不含空格(使用下划线),且最多 100 个字符。不得以
"、\、=、+或-开头,区分大小写(af_purchase≠af_PURCHASE),并且可以包含非英文字符。 - 每个事件: 最多 25 个参数。
- 参数名称 最多 40 个字符。
- 参数值 不得超过 1000 个字符(过长的值可能被截断)。请将事件的总值保持在 2000 个字符以内。
- 收入 / 价格值 只能使用数字和单个小数点,小数点后最多 5 位。
- 基数(Cardinality): 每天最多 300 个唯一事件名称。
- 唯一用户 仅统计用户安装应用后的前 100 个事件。
- 引荐 URL(Referring URLs) 必须经过 URL 编码。
- Meta(Facebook)广告 对事件参数施加额外限制。
Custom event
Send a custom event
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
輸入
输入
| Field | Type | Description |
|---|---|---|
eventName | String | Event name. |
parameters | HashMap<String, Object> | Event parameters. |
platforms | VGSDKAnalyticsPlatform... | Target providers. Each entry selects a provider + event-name prefix. |
platforms[].provider | VGSDKAnalyticsProvider | Provider to send to: see VGSDKAnalyticsProvider. |
platforms[].prefix | String | Prefix prepended to the event name for that provider. |
| 欄位 | 型別 | 說明 |
|---|---|---|
eventName | String | 事件名稱。 |
parameters | HashMap<String, Object> | 事件參數。 |
platforms | VGSDKAnalyticsPlatform... | 目標供應商。每個項目會選擇一個供應商+事件名稱前綴。 |
platforms[].provider | VGSDKAnalyticsProvider | 要傳送到的供應商: 請參閱 VGSDKAnalyticsProvider。 |
platforms[].prefix | String | 為該供應商加在事件名稱前的前綴。 |
| 字段 | 类型 | 描述 |
|---|---|---|
eventName | String | 事件名称。 |
parameters | HashMap<String, Object> | 事件参数。 |
platforms | VGSDKAnalyticsPlatform... | 目标提供方。每个条目选择一个提供方 + 事件名称前缀。 |
platforms[].provider | VGSDKAnalyticsProvider | 要发送到的提供方: 请参阅 VGSDKAnalyticsProvider。 |
platforms[].prefix | String | 为该提供方在事件名称前添加的前缀。 |
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
輸入
输入
| Field | Type | Description |
|---|---|---|
eventName | String | Event name. |
parameters | HashMap<String, Object> | Event parameters. |
| 欄位 | 型別 | 說明 |
|---|---|---|
eventName | String | 事件名稱。 |
parameters | HashMap<String, Object> | 事件參數。 |
| 字段 | 类型 | 描述 |
|---|---|---|
eventName | String | 事件名称。 |
parameters | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
size | String | Payload / resource size. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
size | String | 負載/資源大小。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
size | String | 负载 / 资源大小。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
progress | String | Progress marker. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
progress | String | 進度標記。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
progress | String | 进度标记。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
progress | String | Progress marker. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
progress | String | 進度標記。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
progress | String | 进度标记。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
progress | String | Progress marker. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
progress | String | 進度標記。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
progress | String | 进度标记。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
progress | String | Progress marker. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
progress | String | 進度標記。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
progress | String | 进度标记。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
progress | String | Progress marker. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
progress | String | 進度標記。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
progress | String | 进度标记。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
itemId | String | Item id. |
itemName | String | Item name. |
itemPrice | String | Item price. |
itemCurrency | String | Currency code. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
itemId | String | 道具 ID。 |
itemName | String | 道具名稱。 |
itemPrice | String | 道具價格。 |
itemCurrency | String | 貨幣代碼。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
itemId | String | 物品 id。 |
itemName | String | 物品名称。 |
itemPrice | String | 物品价格。 |
itemCurrency | String | 货币代码。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
itemId | String | Item id. |
itemName | String | Item name. |
itemPrice | String | Item price. |
itemCurrency | String | Currency code. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
itemId | String | 道具 ID。 |
itemName | String | 道具名稱。 |
itemPrice | String | 道具價格。 |
itemCurrency | String | 貨幣代碼。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
itemId | String | 物品 id。 |
itemName | String | 物品名称。 |
itemPrice | String | 物品价格。 |
itemCurrency | String | 货币代码。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
currentVipLevel | String | New VIP level. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
currentVipLevel | String | 新的 VIP 等級。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
currentVipLevel | String | 新的 VIP 等级。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
itemId | String | Item id. |
itemName | String | Item name. |
itemVipLevel | String | VIP level of the item. |
itemPrice | String | Item price. |
itemCurrency | String | Currency code. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
itemId | String | 道具 ID。 |
itemName | String | 道具名稱。 |
itemVipLevel | String | 道具的 VIP 等級。 |
itemPrice | String | 道具價格。 |
itemCurrency | String | 貨幣代碼。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
itemId | String | 物品 id。 |
itemName | String | 物品名称。 |
itemVipLevel | String | 物品的 VIP 等级。 |
itemPrice | String | 物品价格。 |
itemCurrency | String | 货币代码。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
currentLevel | String | New level. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
currentLevel | String | 新的等級。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
currentLevel | String | 新的等级。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
mainQuestId | String | Main-quest id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
mainQuestId | String | 主線任務 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
mainQuestId | String | 主线任务 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
dailyQuestId | String | Daily-quest id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
dailyQuestId | String | 每日任務 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
dailyQuestId | String | 每日任务 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
dailyRewardId | String | Daily-reward id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
dailyRewardId | String | 每日獎勵 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
dailyRewardId | String | 每日奖励 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
itemId | String | Item id. |
itemName | String | Item name. |
itemPrice | String | Item price. |
itemCurrency | String | Currency code. |
itemQuantity | String | Item quantity. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
itemId | String | 道具 ID。 |
itemName | String | 道具名稱。 |
itemPrice | String | 道具價格。 |
itemCurrency | String | 貨幣代碼。 |
itemQuantity | String | 道具數量。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
itemId | String | 物品 id。 |
itemName | String | 物品名称。 |
itemPrice | String | 物品价格。 |
itemCurrency | String | 货币代码。 |
itemQuantity | String | 物品数量。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
itemId | String | Item id. |
itemName | String | Item name. |
itemPrice | String | Item price. |
itemCurrency | String | Currency code. |
itemQuantity | String | Item quantity. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
itemId | String | 道具 ID。 |
itemName | String | 道具名稱。 |
itemPrice | String | 道具價格。 |
itemCurrency | String | 貨幣代碼。 |
itemQuantity | String | 道具數量。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
itemId | String | 物品 id。 |
itemName | String | 物品名称。 |
itemPrice | String | 物品价格。 |
itemCurrency | String | 货币代码。 |
itemQuantity | String | 物品数量。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
gachaType | String | Gacha type/banner. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
gachaType | String | 轉蛋類型/卡池。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
gachaType | String | 抽卡类型 / 卡池。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
guildId | String | Guild id. |
guildName | String | Guild name. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
guildId | String | 公會 ID。 |
guildName | String | 公會名稱。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
guildId | String | 公会 id。 |
guildName | String | 公会名称。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
guildId | String | Guild id. |
guildName | String | Guild name. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
guildId | String | 公會 ID。 |
guildName | String | 公會名稱。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
guildId | String | 公会 id。 |
guildName | String | 公会名称。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
guildId | String | Guild id. |
guildName | String | Guild name. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
guildId | String | 公會 ID。 |
guildName | String | 公會名稱。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
guildId | String | 公会 id。 |
guildName | String | 公会名称。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
platform | String | Social platform name. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
platform | String | 社群平台名稱。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
platform | String | 社交平台名称。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
platform | String | Social platform name. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
platform | String | 社群平台名稱。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
platform | String | 社交平台名称。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
itemId | String | Item id. |
itemName | String | Item name. |
itemPrice | String | Item price. |
itemCurrency | String | Currency code. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
itemId | String | 道具 ID。 |
itemName | String | 道具名稱。 |
itemPrice | String | 道具價格。 |
itemCurrency | String | 貨幣代碼。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
itemId | String | 物品 id。 |
itemName | String | 物品名称。 |
itemPrice | String | 物品价格。 |
itemCurrency | String | 货币代码。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
roleId | String | Character/role id. |
serverId | String | Game server id. |
extraData | HashMap<String, Object> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
roleId | String | 角色 ID。 |
serverId | String | 遊戲伺服器 ID。 |
extraData | HashMap<String, Object> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
roleId | String | 角色 id。 |
serverId | String | 游戏服务器 id。 |
extraData | HashMap<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
輸入
输入
| Field | Type | Description |
|---|---|---|
monetizationNetwork | String | Monetization network name. |
mediationNetwork | VGSDKAdRevenueMediationNetwork | Mediation network: see Ad revenue mediation network. |
revenue | Double | Revenue amount. |
currencyCode | String | Currency code. |
extraData | Map<String, String> | Additional custom key/values attached to the event. |
| 欄位 | 型別 | 說明 |
|---|---|---|
monetizationNetwork | String | 營利聯播網名稱。 |
mediationNetwork | VGSDKAdRevenueMediationNetwork | 中介聯播網: 請參閱 廣告收益中介聯播網。 |
revenue | Double | 收益金額。 |
currencyCode | String | 貨幣代碼。 |
extraData | Map<String, String> | 附加到事件的額外自訂鍵/值。 |
| 字段 | 类型 | 描述 |
|---|---|---|
monetizationNetwork | String | 变现网络名称。 |
mediationNetwork | VGSDKAdRevenueMediationNetwork | 聚合网络: 请参阅 广告收入聚合网络。 |
revenue | Double | 收入金额。 |
currencyCode | String | 货币代码。 |
extraData | Map<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
輸入
输入
| Field | Type | Description |
|---|---|---|
info | VGSDKSupportInfo | Player context: full model: VGSDKSupportInfo. |
| 欄位 | 型別 | 說明 |
|---|---|---|
info | VGSDKSupportInfo | 玩家情境: 完整模型:VGSDKSupportInfo。 |
| 字段 | 类型 | 描述 |
|---|---|---|
info | VGSDKSupportInfo | 玩家上下文: 完整模型:VGSDKSupportInfo。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onAction | Map<String, Any> | An in-portal action the player triggered, with its payload. |
onClosed | : | The support center was dismissed. |
onError | VGSDKError | An error occurred: see General error codes. |
| 欄位 | 型別 | 說明 |
|---|---|---|
onAction | Map<String, Any> | 玩家在支援中心內觸發的操作,附帶其負載。 |
onClosed | : | 支援中心已關閉。 |
onError | VGSDKError | 發生錯誤: 請參閱 一般錯誤碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
onAction | Map<String, Any> | 玩家在门户内触发的操作及其负载。 |
onClosed | : | 客户支持中心已关闭。 |
onError | VGSDKError | 发生了错误: 请参阅 通用错误码。 |
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
輸入
输入
| Field | Type | Description |
|---|---|---|
rewardedVideoListener | PassLevelPlayRewardedVideoListener | Rewarded-video ad-event listener (see Show rewarded video). Ad/reward events for later shows arrive here. |
initCallback | PassInitIronSourceCallback | Initialization listener: reports init success/failure. |
| 欄位 | 型別 | 說明 |
|---|---|---|
rewardedVideoListener | PassLevelPlayRewardedVideoListener | 獎勵影片廣告事件監聽器(請參閱「顯示獎勵影片」)。後續顯示的廣告/獎勵事件會送達這裡。 |
initCallback | PassInitIronSourceCallback | 初始化監聽器: 回報初始化成功/失敗。 |
| 字段 | 类型 | 描述 |
|---|---|---|
rewardedVideoListener | PassLevelPlayRewardedVideoListener | 激励视频广告事件监听器(见“展示激励视频”)。后续展示的广告/奖励事件会送达这里。 |
initCallback | PassInitIronSourceCallback | 初始化监听器: 报告初始化成功/失败。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
initCallback.onComplete | () -> Unit | Initialization finished: ironSource is ready. |
initCallback.onFail | () -> Unit | Initialization failed. |
adRewarded | (Placement?, AdInfo?) -> Unit | Reward earned: grant it here. |
adAvailable | (AdInfo?) -> Unit | An ad is available. |
adUnavailable | () -> Unit | No ad available. |
adOpened | (AdInfo?) -> Unit | Ad opened. |
adClicked | (Placement?, AdInfo?) -> Unit | Ad clicked. |
adClosed | (AdInfo?) -> Unit | Ad closed. |
adShowFailed | (IronSourceError?, AdInfo?) -> Unit | Ad failed to show: carries the underlying ironSource error (its native code, not a VGSDK code). |
failed | () -> Unit | A 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 initIronSourceInput
輸入
输入
| Field | Type | Description |
|---|---|---|
rewardVideo | RewardVideo | Built with a placement name and a network-state flag. |
rewardVideo.placementName | String | Placement to show. |
rewardVideo.trackNetworkState | Boolean | Whether to track network state. |
| 欄位 | 型別 | 說明 |
|---|---|---|
rewardVideo | RewardVideo | 以版位名稱與網路狀態旗標建構。 |
rewardVideo.placementName | String | 要顯示的版位。 |
rewardVideo.trackNetworkState | Boolean | 是否追蹤網路狀態。 |
| 字段 | 类型 | 描述 |
|---|---|---|
rewardVideo | RewardVideo | 以广告位名称与网络状态标志构建。 |
rewardVideo.placementName | String | 要展示的广告位。 |
rewardVideo.trackNetworkState | Boolean | 是否跟踪网络状态。 |
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
輸入
输入
| Field | Type | Description |
|---|---|---|
userID | String | Dynamic user id for verifying rewarded-ad transactions: set before showing the ad, returned in the server-to-server reward callback (1 to 64 alphanumeric characters). |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | String | 用於驗證獎勵廣告交易的動態使用者 ID: 需在顯示廣告前設定。會在伺服器對伺服器獎勵回呼中回傳(1 至 64 個英數字元)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | String | 用于验证激励广告交易的动态用户 id: 需在展示广告前设置。会在服务端到服务端奖励回调中返回(1 至 64 个字母数字字符)。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Meta Audience Network
Show interstitial
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
輸入
输入
| Field | Type | Description |
|---|---|---|
placementId | String | Meta placement id. |
listener | VGSDKMetaAdsInterstitialListener | Ad-event listener. |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementId | String | Meta 版位 ID。 |
listener | VGSDKMetaAdsInterstitialListener | 廣告事件監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementId | String | Meta 广告位 id。 |
listener | VGSDKMetaAdsInterstitialListener | 广告事件监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
adLoaded | (Ad?) -> Unit | Ad loaded. |
interstitialDisplayed | (Ad?) -> Unit | Interstitial displayed. |
interstitialDismissed | (Ad?) -> Unit | Interstitial dismissed. |
adClicked | (Ad?) -> Unit | Ad clicked. |
loggingImpression | (Ad?) -> Unit | Impression logged. |
error | (Ad?, AdError?) -> Unit | Load/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
輸入
输入
| Field | Type | Description |
|---|---|---|
placementId | String | Meta placement id. |
userId | String | Player id for the reward callback. |
currency | String | Reward currency name. |
listener | VGSDKMetaAdsRewardedVideoListener | Ad-event listener. |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementId | String | Meta 版位 ID。 |
userId | String | 用於獎勵回呼的玩家 ID。 |
currency | String | 獎勵貨幣名稱。 |
listener | VGSDKMetaAdsRewardedVideoListener | 廣告事件監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementId | String | Meta 广告位 id。 |
userId | String | 用于奖励回调的玩家 id。 |
currency | String | 奖励货币名称。 |
listener | VGSDKMetaAdsRewardedVideoListener | 广告事件监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
rewardedVideoCompleted | () -> Unit | Reward earned: grant it here. |
rewardedVideoClosed | () -> Unit | Ad closed. |
rewardServerSuccess | () -> Unit | Server-to-server reward callback succeeded. |
rewardServerFailed | () -> Unit | Server-to-server reward callback failed. |
adLoaded | (Ad?) -> Unit | Ad loaded. |
error | (Ad?, AdError?) -> Unit | Load/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
輸入
输入
| Field | Type | Description |
|---|---|---|
placementId | String | Meta placement id. |
userId | String | Player id for the reward callback. |
currency | String | Reward currency name. |
listener | VGSDKMetaAdsRewardedInterstitialListener | Ad-event listener. |
| 欄位 | 型別 | 說明 |
|---|---|---|
placementId | String | Meta 版位 ID。 |
userId | String | 用於獎勵回呼的玩家 ID。 |
currency | String | 獎勵貨幣名稱。 |
listener | VGSDKMetaAdsRewardedInterstitialListener | 廣告事件監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
placementId | String | Meta 广告位 id。 |
userId | String | 用于奖励回调的玩家 id。 |
currency | String | 奖励货币名称。 |
listener | VGSDKMetaAdsRewardedInterstitialListener | 广告事件监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
rewardedInterstitialCompleted | () -> Unit | Reward earned: grant it here. |
rewardedInterstitialClosed | () -> Unit | Ad closed. |
rewardServerSuccess | () -> Unit | Server-to-server reward callback succeeded. |
rewardServerFailed | () -> Unit | Server-to-server reward callback failed. |
adLoaded | (Ad?) -> Unit | Ad loaded. |
error | (Ad?, AdError?) -> Unit | Load/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 messaging/inbox is backend-driven, so the client’s only touchpoint is the game context it targets on. Firebase Remote Config and the in-app WebView round it out. Firebase Cloud Messaging, local push, Apollo (push / in-app / inbox), and Firebase in-app messages are delivered server-side and expose no client call.
再行銷,依供應商分組。CleverTap 涵蓋應用程式內訊息與應用程式收件匣。Apollo 的訊息/收件匣由後端驅動,因此用戶端唯一的接觸點是它所鎖定的遊戲情境。Firebase Remote Config 與應用程式內 WebView 補足其餘部分。Firebase Cloud Messaging、本機推播、Apollo(推播/應用程式內/收件匣)以及 Firebase 應用程式內訊息皆由伺服器端傳遞,不提供任何用戶端呼叫。
按提供方分组的再互动能力。CleverTap 负责应用内消息和应用收件箱。Apollo 的消息 / 收件箱由后端驱动,因此客户端唯一的接触点是它所定位的游戏上下文。此外还有 Firebase Remote Config 和应用内 WebView。Firebase Cloud Messaging、本地推送、Apollo(推送 / 应用内 / 收件箱)以及 Firebase 应用内消息均由服务端下发,不暴露客户端调用。
CleverTap
Set CleverTap listener
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
輸入
输入
| Field | Type | Description |
|---|---|---|
listener | CleverTapInAppNotificationButtonListener | Listener for in-app-message button taps. |
| 欄位 | 型別 | 說明 |
|---|---|---|
listener | CleverTapInAppNotificationButtonListener | 用於接收應用程式內訊息按鈕點擊的監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
listener | CleverTapInAppNotificationButtonListener | 用于接收应用内消息按钮点击的监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onCleverTapInAppButtonClick | (HashMap<String, String>?) -> Unit | Payload 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
輸入
输入
| Field | Type | Description |
|---|---|---|
provider | VGSDKAppInboxCleverTapProvider | The CleverTap app-inbox provider. |
provider.style | VGSDKAppInboxCleverTapStyle | Theming (title, tabs, colors). Uses defaults when not customized. |
listener | VGSDKCleverTapInboxListener | Inbox listener. |
| 欄位 | 型別 | 說明 |
|---|---|---|
provider | VGSDKAppInboxCleverTapProvider | CleverTap 應用程式收件匣供應商。 |
provider.style | VGSDKAppInboxCleverTapStyle | 主題設定(標題、分頁、色彩)。未自訂時使用預設值。 |
listener | VGSDKCleverTapInboxListener | 收件匣監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
provider | VGSDKAppInboxCleverTapProvider | CleverTap 应用收件箱提供方。 |
provider.style | VGSDKAppInboxCleverTapStyle | 主题设置(标题、标签、颜色)。未自定义时使用默认值。 |
listener | VGSDKCleverTapInboxListener | 收件箱监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onItemClicked | (VGSDKCleverTapInboxMessage, VGSDKCleverTapInboxMessageContent, HashMap<String, String>?) -> Unit | The 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 都必须非空,否则该调用被忽略。
VGSDKGameContext context = new VGSDKGameContext("role-1", "server-1");
VGSDK.setGameContext(context);Input
輸入
输入
| Field | Type | Description |
|---|---|---|
gameContext | VGSDKGameContext | Wrapper describing the active session. |
gameContext.roleId | String | Active character/role id (must be non-empty). |
gameContext.serverId | String | Active server id (must be non-empty). |
| 欄位 | 型別 | 說明 |
|---|---|---|
gameContext | VGSDKGameContext | 描述目前工作階段的包裝物件。 |
gameContext.roleId | String | 目前的角色 id(不得為空)。 |
gameContext.serverId | String | 目前的伺服器 id(不得為空)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
gameContext | VGSDKGameContext | 描述当前会话的包装对象。 |
gameContext.roleId | String | 当前的角色 id(不得为空)。 |
gameContext.serverId | String | 当前的服务器 id(不得为空)。 |
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Set in-app-message deep-link listener
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
輸入
输入
| Field | Type | Description |
|---|---|---|
listener | VGSDKInAppMessageDeepLinkListener? | The listener to register (pass none to clear it). |
| 欄位 | 型別 | 說明 |
|---|---|---|
listener | VGSDKInAppMessageDeepLinkListener? | 要註冊的監聽器(傳入無則清除)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
listener | VGSDKInAppMessageDeepLinkListener? | 要注册的监听器(传入无则清除)。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onDeepLink | (String) -> Unit | The 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 takes its visibility over for the rest of the session.
顯示 Apollo 應用程式內收件匣的浮動按鈕,並在本次工作階段接手其顯示與隱藏。
显示 Apollo 应用内收件箱的悬浮按钮,并在本次会话接手其显示与隐藏。
The first call to either visibility method hands the button to your game for the rest of the session, so the SDK stops showing and hiding it on its own. The hand over resets on logout and on relaunch. A call made while the app inbox is disabled for your game is accepted and reported in the SDK log as having no effect.
第一次呼叫任一個顯示控制方法後,按鈕即在本次工作階段交由遊戲控制,SDK 不再自行顯示或隱藏它。此控制權會在登出與重新啟動時歸還 SDK。若你的遊戲未啟用應用程式內收件匣,呼叫仍會被接受,並在 SDK 日誌中回報為未產生效果。
第一次调用任一个显示控制方法后,按钮即在本次会话交由游戏控制,SDK 不再自行显示或隐藏它。该控制权会在登出与重新启动时归还 SDK。若你的游戏未启用应用内收件箱,调用仍会被接受,并在 SDK 日志中报告为未产生效果。
VGSDKAppInbox.showFloatingButton();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Hide the app inbox floating button
Removes the Apollo app inbox floating button and takes its visibility over for the rest of the session.
移除 Apollo 應用程式內收件匣的浮動按鈕,並在本次工作階段接手其顯示與隱藏。
移除 Apollo 应用内收件箱的悬浮按钮,并在本次会话接手其显示与隐藏。
The dismiss zone and any open confirmation popup go with it, and a drag in progress is cancelled immediately. The button’s last position survives, so a later show restores it. An open message list is left untouched, and a message arriving while the button is hidden still updates the unread count.
移除按鈕時,拖曳關閉區與任何開啟中的確認彈窗會一併移除,正在進行的拖曳也會立即取消。按鈕最後的位置會保留,因此之後呼叫顯示時會回到原處。開啟中的訊息列表不受影響,按鈕隱藏期間收到的訊息仍會更新未讀數量。
移除按钮时,拖拽关闭区与任何打开中的确认弹窗会一并移除,正在进行的拖拽也会立即取消。按钮最后的位置会保留,因此之后调用显示时会回到原处。打开中的消息列表不受影响,按钮隐藏期间收到的消息仍会更新未读数量。
VGSDKAppInbox.hideFloatingButton();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
No return value (fire-and-forget).
無回傳值(fire-and-forget)。
无返回值(fire-and-forget)。
Firebase
Fetch Firebase Remote Config
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
輸入
输入
| Field | Type | Description |
|---|---|---|
listener | RemoteConfigListener | Fetch-result listener. Override onSuccess/onFail. |
| 欄位 | 型別 | 說明 |
|---|---|---|
listener | RemoteConfigListener | 擷取結果監聽器。覆寫 onSuccess/onFail。 |
| 字段 | 类型 | 描述 |
|---|---|---|
listener | RemoteConfigListener | 获取结果监听器。重写 onSuccess/onFail。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (Map<*, *>) -> Unit | All remote-config keys and values. |
onFail | () -> Unit | Fetch 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
輸入
输入
| Field | Type | Description |
|---|---|---|
url | String? | URL to load. |
pageListener | ShowPageListener | WebView lifecycle listener. |
| 欄位 | 型別 | 說明 |
|---|---|---|
url | String? | 要載入的 URL。 |
pageListener | ShowPageListener | WebView 生命週期監聽器。 |
| 字段 | 类型 | 描述 |
|---|---|---|
url | String? | 要加载的 URL。 |
pageListener | ShowPageListener | WebView 生命周期监听器。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onComplete | () -> Unit | Fires when the WebView is dismissed. |
onError | (Error?) -> Unit | Failed 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 代码)。 |
Notification
Add a custom sound
Deliver a custom sound with push notifications: no API call, just ship the audio file with your app:
- 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. - Put it in
res/raw/of your app module. - Reference it by resource name in the push payload’s
soundfield: the extension is ignored (my_notificationandmy_notification.mp3both resolveres/raw/my_notification). If the name doesn’t resolve, the default notification sound is used.
為推播通知提供自訂音效:無需 API 呼叫,只要將音訊檔隨應用程式一起打包:
- 準備音效檔:
.mp3/.wav/.ogg,一段簡短的提示音。檔名只能使用小寫字母、數字與底線([a-z0-9_]),因為它會成為資源名稱。 - 將其放入應用程式模組的
res/raw/。 - 於推播負載的
sound欄位中以資源名稱參照它:副檔名會被忽略(my_notification和my_notification.mp3都會解析到res/raw/my_notification)。若名稱無法解析,則使用預設通知音效。
为推送通知提供自定义声音:无需 API 调用,只需将音频文件随应用一起打包:
- 准备声音文件:
.mp3/.wav/.ogg,一段简短的提示音。文件名只能使用小写字母、数字和下划线([a-z0-9_]),因为它会成为资源名。 - 将其放入应用模块的
res/raw/。 - 在推送负载的
sound字段中按资源名引用它:扩展名会被忽略(my_notification和my_notification.mp3都会解析到res/raw/my_notification)。若名称无法解析,则使用默认通知声音。
Set the notification icon
Show a custom notification icon on Android:
- Prepare two icons: a small icon at 128×128 and a large icon at 256×256 (px).
- Create
small_icon_notification.pngandlarge_icon_notification.pngfrom them, and save both in theres/drawablefolder. - Add the following to
AndroidManifest.xml:
在 Android 上顯示自訂通知圖示:
- 準備兩個圖示:小圖示 128×128、大圖示 256×256(像素)。
- 依此建立
small_icon_notification.png與large_icon_notification.png,並將兩者儲存至res/drawable資料夾。 - 將以下內容加入
AndroidManifest.xml:
在 Android 上显示自定义通知图标:
- 准备两个图标:小图标 128×128、大图标 256×256(像素)。
- 据此创建
small_icon_notification.png和large_icon_notification.png,并将两者保存到res/drawable文件夹。 - 将以下内容添加到
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:
- Create
res/values/color.xmlif it doesn’t exist. - Add a
colorNotificationentry: set its value to the HEX color you want (replace{your_icon_color}), for example#EC7710:
為下拉通知欄中顯示的通知圖示著色:
- 若不存在,建立
res/values/color.xml。 - 加入
colorNotification項目:將其值設為你想要的 HEX 色彩(替換{your_icon_color}),例如#EC7710:
为下拉通知栏中显示的通知图标着色:
- 若不存在,创建
res/values/color.xml。 - 添加
colorNotification条目:将其值设为你想要的 HEX 颜色(替换{your_icon_color}),例如#EC7710:
<color name="colorNotification">#EC7710</color>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
輸入
输入
| Field | Type | Description |
|---|---|---|
socialType | SocialType | Social channel to read (Facebook): see SocialType. |
listener | SocialListener<SocialUserInfo> | Result listener (onSuccess / onFail / onCancel). |
| 欄位 | 型別 | 說明 |
|---|---|---|
socialType | SocialType | 要讀取的社群頻道(Facebook): 請參閱 SocialType。 |
listener | SocialListener<SocialUserInfo> | 結果監聽器(onSuccess / onFail / onCancel)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
socialType | SocialType | 要读取的社交渠道(Facebook): 请参阅 SocialType。 |
listener | SocialListener<SocialUserInfo> | 结果监听器(onSuccess / onFail / onCancel)。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: SocialUserInfo) -> Unit | Delivers the typed profile model (not raw JSON). Fields: SocialUserInfo. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called 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
輸入
输入
| Field | Type | Description |
|---|---|---|
getFriendsSocialType | GetFriendsSocialType.Facebook | Facebook friends query: full model: GetFriendsSocialType. |
listener | SocialListener<List<SocialUserInfo>> | Result listener (onSuccess / onFail / onCancel). |
| 欄位 | 型別 | 說明 |
|---|---|---|
getFriendsSocialType | GetFriendsSocialType.Facebook | Facebook 好友查詢: 完整模型:GetFriendsSocialType。 |
listener | SocialListener<List<SocialUserInfo>> | 結果監聽器(onSuccess / onFail / onCancel)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
getFriendsSocialType | GetFriendsSocialType.Facebook | Facebook 好友查询: 完整模型:GetFriendsSocialType。 |
listener | SocialListener<List<SocialUserInfo>> | 结果监听器(onSuccess / onFail / onCancel)。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: List<SocialUserInfo>) -> Unit | Delivers the app friends as typed models (not raw JSON). Each entry: SocialUserInfo. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called 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
輸入
输入
| Field | Type | Description |
|---|---|---|
inviteFriendsSocialType | InviteFriendsSocialType.Facebook | Facebook invite request: full model: InviteFriendsSocialType. |
listener | SocialListener<List<String>> | Result listener (onSuccess / onFail / onCancel). |
| 欄位 | 型別 | 說明 |
|---|---|---|
inviteFriendsSocialType | InviteFriendsSocialType.Facebook | Facebook 邀請請求: 完整模型:InviteFriendsSocialType。 |
listener | SocialListener<List<String>> | 結果監聽器(onSuccess / onFail / onCancel)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
inviteFriendsSocialType | InviteFriendsSocialType.Facebook | Facebook 邀请请求: 完整模型:InviteFriendsSocialType。 |
listener | SocialListener<List<String>> | 结果监听器(onSuccess / onFail / onCancel)。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: List<String>) -> Unit | Ids of the friends that were invited. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called 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 分享对话框分享一张照片。
// 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
輸入
输入
| Field | Type | Description |
|---|---|---|
shareType | ShareType.FacebookPhoto | Facebook photo share (via shareToSocial): full model: ShareType. |
listener | SocialListener<Any> | Result listener. Facebook shares resolve the result to Any/Object. |
| 欄位 | 型別 | 說明 |
|---|---|---|
shareType | ShareType.FacebookPhoto | Facebook 相片分享(透過 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<Any> | 結果監聽器。Facebook 分享會將結果解析為 Any/Object。 |
| 字段 | 类型 | 描述 |
|---|---|---|
shareType | ShareType.FacebookPhoto | Facebook 照片分享(通过 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<Any> | 结果监听器。Facebook 分享会将结果解析为 Any/Object。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: Any) -> Unit | The photo was shared. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called when the player dismisses the flow. |
| 欄位 | 型別 | 說明 |
|---|---|---|
onSuccess | (result: Any) -> Unit | 相片已分享。 |
onFail | (message: String?) -> Unit | 失敗時呼叫,並帶有錯誤訊息。 |
onCancel | () -> Unit | 當玩家關閉流程時呼叫。 |
| 字段 | 类型 | 描述 |
|---|---|---|
onSuccess | (result: Any) -> Unit | 照片已分享。 |
onFail | (message: String?) -> Unit | 失败时调用,并带有错误消息。 |
onCancel | () -> Unit | 当玩家关闭流程时调用。 |
Share link to Facebook
Shares a link.
分享連結。
分享一个链接。
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
輸入
输入
| Field | Type | Description |
|---|---|---|
shareType | ShareType.FacebookLink | Facebook link share (via shareToSocial): full model: ShareType. |
listener | SocialListener<Any> | Result listener. Facebook shares resolve the result to Any/Object. |
| 欄位 | 型別 | 說明 |
|---|---|---|
shareType | ShareType.FacebookLink | Facebook 連結分享(透過 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<Any> | 結果監聽器。Facebook 分享會將結果解析為 Any/Object。 |
| 字段 | 类型 | 描述 |
|---|---|---|
shareType | ShareType.FacebookLink | Facebook 链接分享(通过 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<Any> | 结果监听器。Facebook 分享会将结果解析为 Any/Object。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: Any) -> Unit | The link was shared. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called when the player dismisses the flow. |
| 欄位 | 型別 | 說明 |
|---|---|---|
onSuccess | (result: Any) -> Unit | 連結已分享。 |
onFail | (message: String?) -> Unit | 失敗時呼叫,並帶有錯誤訊息。 |
onCancel | () -> Unit | 當玩家關閉流程時呼叫。 |
| 字段 | 类型 | 描述 |
|---|---|---|
onSuccess | (result: Any) -> Unit | 链接已分享。 |
onFail | (message: String?) -> Unit | 失败时调用,并带有错误消息。 |
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
輸入
输入
| Field | Type | Description |
|---|---|---|
shareType | ShareType.InstagramPhotoFeed | Instagram feed image share (via shareToSocial): full model: ShareType. |
listener | SocialListener<String> | Result listener. Instagram shares resolve the result to String. |
| 欄位 | 型別 | 說明 |
|---|---|---|
shareType | ShareType.InstagramPhotoFeed | Instagram 動態圖片分享(透過 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<String> | 結果監聽器。Instagram 分享會將結果解析為 String。 |
| 字段 | 类型 | 描述 |
|---|---|---|
shareType | ShareType.InstagramPhotoFeed | Instagram 动态图片分享(通过 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<String> | 结果监听器。Instagram 分享会将结果解析为 String。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: String) -> Unit | The image was shared to the Instagram feed. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called 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
輸入
输入
| Field | Type | Description |
|---|---|---|
shareType | ShareType.InstagramPhotoStory | Instagram Stories image share (via shareToSocial): full model: ShareType. |
listener | SocialListener<String> | Result listener. Instagram shares resolve the result to String. |
| 欄位 | 型別 | 說明 |
|---|---|---|
shareType | ShareType.InstagramPhotoStory | Instagram 限時動態圖片分享(透過 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<String> | 結果監聽器。Instagram 分享會將結果解析為 String。 |
| 字段 | 类型 | 描述 |
|---|---|---|
shareType | ShareType.InstagramPhotoStory | Instagram 快拍图片分享(通过 shareToSocial): 完整模型:ShareType。 |
listener | SocialListener<String> | 结果监听器。Instagram 分享会将结果解析为 String。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
onSuccess | (result: String) -> Unit | The image was shared to Instagram Stories. |
onFail | (message: String?) -> Unit | Called on failure with an error message. |
onCancel | () -> Unit | Called 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
輸入
输入
| Field | Type | Description |
|---|---|---|
text | String | Text to translate. |
language | String | Target language code (e.g. “vi”). |
| 欄位 | 型別 | 說明 |
|---|---|---|
text | String | 要翻譯的文字。 |
language | String | 目標語言代碼(例如 “vi”)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
text | String | 要翻译的文本。 |
language | String | 目标语言代码(例如 “vi”)。 |
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
output | String | The translated text. |
| 欄位 | 型別 | 說明 |
|---|---|---|
output | String | 翻譯後的文字。 |
| 字段 | 类型 | 描述 |
|---|---|---|
output | String | 翻译后的文本。 |
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
輸出
输出
| Field | Type | Description |
|---|---|---|
version | String | The SDK version string. |
| 欄位 | 型別 | 說明 |
|---|---|---|
version | String | SDK 版本字串。 |
| 字段 | 类型 | 描述 |
|---|---|---|
version | String | SDK 版本字符串。 |
Get current language
Returns the SDK’s active language code.
傳回 SDK 使用中的語言代碼。
返回 SDK 的当前语言代码。
String language = PASS.getLanguage();Input
輸入
输入
No input.
無輸入。
无输入。
Output
輸出
输出
| Field | Type | Description |
|---|---|---|
language | String | Active language code (e.g. “vi”, “en”). |
| 欄位 | 型別 | 說明 |
|---|---|---|
language | String | 使用中的語言代碼(例如 “vi”、“en”)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
language | String | 当前语言代码(例如 “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
輸出
输出
| Field | Type | Description |
|---|---|---|
user | UserInfo? | The signed-in user, or absent when no session exists. Fields: UserInfo. |
| 欄位 | 型別 | 說明 |
|---|---|---|
user | UserInfo? | 已登入的使用者。沒有工作階段時不存在。欄位詳見 UserInfo。 |
| 字段 | 类型 | 描述 |
|---|---|---|
user | UserInfo? | 已登录的用户。没有会话时不存在。字段详见 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
輸出
输出
| Field | Type | Description |
|---|---|---|
countryCode | String? | The player’s country code, or OT (other) when outside the game’s publish market. Absent when not yet detected. |
| 欄位 | 型別 | 說明 |
|---|---|---|
countryCode | String? | 玩家的國家/地區代碼。位於遊戲發行市場之外時為 OT(其他)。尚未偵測到時不存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
countryCode | String? | 玩家的国家 / 地区代码。位于游戏发行市场之外时为 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
輸出
输出
| Field | Type | Description |
|---|---|---|
deviceId | String? | Advertising id when available, otherwise a fallback device id, with dashes replaced by underscores. Absent when unavailable. |
| 欄位 | 型別 | 說明 |
|---|---|---|
deviceId | String? | 可用時為廣告識別碼。否則為備用裝置識別碼,連字號會以底線取代。無法取得時不存在。 |
| 字段 | 类型 | 描述 |
|---|---|---|
deviceId | String? | 可用时为广告标识符。否则为备用设备标识符,连字符会替换为下划线。无法获取时不存在。 |
Data Models
Shared objects and enums referenced by multiple methods, documented once here. For enums, each row is one case: Field = the case, Type = its raw value.
由多個方法參考的共用物件與列舉,於此處統一說明一次。對於列舉,每一列代表一個 case: Field=該 case,Type=其原始值。
被多个方法引用的共享对象与枚举,在此统一记录一次。对于枚举,每一行是一个枚举项: Field = 该枚举项,Type = 其原始值。
VGSDKSupportInfo
Player context passed to Open support center.
傳入「開啟客服中心」的玩家情境。
传入“打开客服中心”的玩家上下文。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
userId | String? | Unique VNGGames user id. |
serverId | String? | Game server id. |
level | String? | Player level. |
roleName | String? | Character/role name. |
loginChannel | String? | Login channel. |
guild | String? | Guild name. |
content | String? | Pre-filled ticket content. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userId | String? | VNGGames 唯一使用者 id。 |
serverId | String? | 遊戲伺服器 id。 |
level | String? | 玩家等級。 |
roleName | String? | 角色名稱。 |
loginChannel | String? | 登入頻道。 |
guild | String? | 公會名稱。 |
content | String? | 預先填入的工單內容。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userId | String? | 唯一的 VNGGames 用户 id。 |
serverId | String? | 游戏服务器 id。 |
level | String? | 玩家等级。 |
roleName | String? | 角色名称。 |
loginChannel | String? | 登录渠道。 |
guild | String? | 公会名称。 |
content | String? | 预填的工单内容。 |
VGSDKAnalyticsProvider
Analytics provider selector for sendCustomEvent (Int enum).
sendCustomEvent 的分析供應商選擇器(Int 列舉)。
sendCustomEvent 的分析提供方选择器(Int 枚举)。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
.appsFlyer | 0 | AppsFlyer. |
.firebase | 1 | Firebase Analytics. |
.dataPlatform | 2 | VNGGames Data Platform. |
.facebook | 3 | Facebook App Events. |
.thinkingData | 4 | ThinkingData. |
.cleverTap | 5 | CleverTap. |
| 欄位 | 型別 | 說明 |
|---|---|---|
.appsFlyer | 0 | AppsFlyer。 |
.firebase | 1 | Firebase Analytics。 |
.dataPlatform | 2 | VNGGames Data Platform。 |
.facebook | 3 | Facebook App Events。 |
.thinkingData | 4 | ThinkingData。 |
.cleverTap | 5 | CleverTap。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.appsFlyer | 0 | AppsFlyer。 |
.firebase | 1 | Firebase Analytics。 |
.dataPlatform | 2 | VNGGames 数据平台。 |
.facebook | 3 | Facebook App Events。 |
.thinkingData | 4 | ThinkingData。 |
.cleverTap | 5 | CleverTap。 |
Analytics default parameters
The default parameters the analytics facade merges into every event it triggers. The SDK fills them automatically: you never set them, and each method’s own inputs and any extraData you pass are added on top. device_info, user_info, response_info, and login_info are JSON-encoded strings. The last two are conditional: see their rows. Used by every method in Analytics.
分析門面合併到它所觸發之每個事件的預設參數。SDK 會自動填入: 你永遠不需設定。每個方法自身的輸入以及你傳入的任何 extraData 會再疊加於其上。device_info、user_info、response_info 與 login_info 為 JSON 編碼字串。後兩者為條件性: 請參閱其對應列。由 分析 中的每個方法使用。
分析门面合并到它触发的每个事件中的默认参数。SDK 会自动填充它们: 你无需设置。每个方法自身的输入以及你传入的任何 extraData 都会叠加在其之上。device_info、user_info、response_info 和 login_info 是 JSON 编码的字符串。后两个是条件性的: 见其对应行。分析 中的每个方法都会使用它们。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
device_info | String | Device info, JSON-encoded: os (the platform name), version (OS version), model (device model). |
device_id | String | Per-device id (advertising id when available, otherwise a fallback device id, prefixed). |
game_version | String | Full game (app) version. |
sdk_version | String | VNGGames SDK version. |
package | String | Game bundle id / package name. |
network_type | String | Active network type at send time. |
timestamp | String | Event time, in milliseconds. |
session_id | String | Analytics session id: a UUID generated once per app run. |
user_info | String | Signed-in user info, JSON-encoded: user_id, social_id, country_code. Ids are empty while signed out. |
appsflyer_id | String | AppsFlyer device UID. |
frb_installation_id | String | Firebase installation id. |
frb_app_instance_id | String | Firebase app-instance id. |
response_info | String | Added only on events that report an outcome. JSON-encoded: status (Success / Failed / Canceled), error_code, remote (0 local, 1 remote). |
login_info | String | Added only on login-flow events. JSON-encoded: method, channel, flow (CreateUser / UpdateUser), step. |
| 欄位 | 型別 | 說明 |
|---|---|---|
device_info | String | 裝置資訊,JSON 編碼:os(平台名稱)、version(作業系統版本)、model(裝置型號)。 |
device_id | String | 每台裝置的 ID(可用時為廣告 ID,否則為備用裝置 ID。含前綴)。 |
game_version | String | 完整的遊戲(應用程式)版本。 |
sdk_version | String | VNGGames SDK 版本。 |
package | String | 遊戲的 bundle id/套件名稱。 |
network_type | String | 傳送當下使用中的網路類型。 |
timestamp | String | 事件時間,以毫秒為單位。 |
session_id | String | 分析工作階段 ID: 每次應用程式執行時產生一次的 UUID。 |
user_info | String | 已登入使用者資訊,JSON 編碼:user_id、social_id、country_code。登出時這些 ID 為空。 |
appsflyer_id | String | AppsFlyer 裝置 UID。 |
frb_installation_id | String | Firebase 安裝 ID。 |
frb_app_instance_id | String | Firebase 應用程式執行個體 ID。 |
response_info | String | 僅在回報結果的事件上加入。JSON 編碼:status(Success/Failed/Canceled)、error_code、remote(0 本機、1 遠端)。 |
login_info | String | 僅在登入流程事件上加入。JSON 編碼:method、channel、flow(CreateUser/UpdateUser)、step。 |
| 字段 | 类型 | 描述 |
|---|---|---|
device_info | String | 设备信息,JSON 编码:os(平台名称)、version(操作系统版本)、model(设备型号)。 |
device_id | String | 每设备 id(可用时为广告 id,否则为备用设备 id。带前缀)。 |
game_version | String | 完整的游戏(应用)版本。 |
sdk_version | String | VNGGames SDK 版本。 |
package | String | 游戏 bundle id / 包名。 |
network_type | String | 发送时的当前网络类型。 |
timestamp | String | 事件时间,以毫秒为单位。 |
session_id | String | 分析会话 id: 每次应用运行生成一次的 UUID。 |
user_info | String | 已登录用户信息,JSON 编码:user_id、social_id、country_code。未登录时这些 id 为空。 |
appsflyer_id | String | AppsFlyer 设备 UID。 |
frb_installation_id | String | Firebase 安装 id。 |
frb_app_instance_id | String | Firebase 应用实例 id。 |
response_info | String | 仅在报告结果的事件上添加。JSON 编码:status(Success / Failed / Canceled)、error_code、remote(0 本地,1 远程)。 |
login_info | String | 仅在登录流程事件上添加。JSON 编码:method、channel、flow(CreateUser / UpdateUser)、step。 |
Analytics platform prefixes
The per-provider prefix the VNGGames SDK inserts into every event it triggers: each event reaches its provider as vgsdk_{prefix}_{event name} (for example, vgsdk_af_app_open). Used by every method in Analytics.
VNGGames SDK 插入到它所觸發之每個事件中的各供應商前綴: 每個事件會以 vgsdk_{prefix}_{event name} 抵達其供應商(例如 vgsdk_af_app_open)。由 分析 中的每個方法使用。
VNGGames SDK 插入到它触发的每个事件中的每提供方前缀: 每个事件以 vgsdk_{prefix}_{event name} 形式到达其提供方(例如 vgsdk_af_app_open)。分析 中的每个方法都会使用它。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
Firebase | frb | Firebase Analytics. |
Facebook | fb | Facebook App Events. |
AppsFlyer | af | AppsFlyer. |
Data Platform | dp | VNGGames Data Platform. |
CleverTap | clt | CleverTap. |
ThinkingData | td | ThinkingData. |
| 欄位 | 型別 | 說明 |
|---|---|---|
Firebase | frb | Firebase Analytics。 |
Facebook | fb | Facebook App Events。 |
AppsFlyer | af | AppsFlyer。 |
Data Platform | dp | VNGGames Data Platform。 |
CleverTap | clt | CleverTap。 |
ThinkingData | td | ThinkingData。 |
| 字段 | 类型 | 描述 |
|---|---|---|
Firebase | frb | Firebase Analytics。 |
Facebook | fb | Facebook App Events。 |
AppsFlyer | af | AppsFlyer。 |
Data Platform | dp | VNGGames 数据平台。 |
CleverTap | clt | CleverTap。 |
ThinkingData | td | ThinkingData。 |
Ad revenue mediation network
Mediation network for ad-revenue reporting (UInt enum), used by miscAdRevenue.
用於廣告收益回報的中介聯播網(UInt 列舉),由 miscAdRevenue 使用。
用于广告收入上报的聚合网络(UInt 枚举),由 miscAdRevenue 使用。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
.googleAdMob | 1 | Google AdMob. |
.ironSource | 2 | ironSource. |
.applovinMax | 3 | AppLovin MAX. |
.fyber | 4 | Fyber. |
.appodeal | 5 | Appodeal. |
.admost | 6 | Admost. |
.topon | 7 | TopOn. |
.tradplus | 8 | TradPlus. |
.yandex | 9 | Yandex. |
.chartBoost | 10 | Chartboost. |
.unity | 11 | Unity Ads. |
.custom | 12 | Custom. |
.directMonetization | 13 | Direct monetization. |
| 欄位 | 型別 | 說明 |
|---|---|---|
.googleAdMob | 1 | Google AdMob。 |
.ironSource | 2 | ironSource。 |
.applovinMax | 3 | AppLovin MAX。 |
.fyber | 4 | Fyber。 |
.appodeal | 5 | Appodeal。 |
.admost | 6 | Admost。 |
.topon | 7 | TopOn。 |
.tradplus | 8 | TradPlus。 |
.yandex | 9 | Yandex。 |
.chartBoost | 10 | Chartboost。 |
.unity | 11 | Unity Ads。 |
.custom | 12 | 自訂。 |
.directMonetization | 13 | 直接營利。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.googleAdMob | 1 | Google AdMob。 |
.ironSource | 2 | ironSource。 |
.applovinMax | 3 | AppLovin MAX。 |
.fyber | 4 | Fyber。 |
.appodeal | 5 | Appodeal。 |
.admost | 6 | Admost。 |
.topon | 7 | TopOn。 |
.tradplus | 8 | TradPlus。 |
.yandex | 9 | Yandex。 |
.chartBoost | 10 | Chartboost。 |
.unity | 11 | Unity Ads。 |
.custom | 12 | 自定义。 |
.directMonetization | 13 | 直接变现。 |
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
欄位
字段
| Field | Type | Description |
|---|---|---|
.FACEBOOK | Facebook | Facebook. |
.ZINGID | ZingID | Zing ID. |
.GOOGLE | Google | Google. |
.EMAIL | Email | Email. |
.GUEST | Guest | Anonymous guest. |
.INSTAGRAM | Instagram | Instagram. |
.APPLE | Apple | Sign in with Apple. |
| 欄位 | 型別 | 說明 |
|---|---|---|
.FACEBOOK | Facebook | Facebook。 |
.ZINGID | ZingID | Zing ID。 |
.GOOGLE | Google | Google。 |
.EMAIL | Email | 電子郵件。 |
.GUEST | Guest | 匿名訪客。 |
.INSTAGRAM | Instagram | Instagram。 |
.APPLE | Apple | 使用 Apple 登入。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.FACEBOOK | Facebook | Facebook。 |
.ZINGID | ZingID | Zing ID。 |
.GOOGLE | Google | Google。 |
.EMAIL | Email | 电子邮箱。 |
.GUEST | Guest | 匿名访客。 |
.INSTAGRAM | Instagram | Instagram。 |
.APPLE | Apple | Sign in with Apple。 |
UserInfo
The signed-in player, delivered by every login callback and by the current-user accessor.
已登入的玩家,由每個登入回呼以及目前使用者存取器傳回。
已登录的玩家,由每个登录回调以及当前用户访问器返回。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
userId | String? | Unique VNGGames user id. |
sessionId | String? | Session token used to authenticate backend calls. |
displayName | String? | Player display name. |
lastUpdateSession | Long | Epoch millis of the last session refresh. |
map | Boolean | Whether the account is protected/secured. |
loginType() | Int | Accessor: the login channel value: 1 Facebook, 3 Google, 4 ZingID, 5 Guest, 7 Apple, 8 Email. |
loginTypeForTracking() | String | The login channel as a string. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userId | String? | VNGGames 唯一使用者 id。 |
sessionId | String? | 用於驗證後端呼叫的工作階段權杖。 |
displayName | String? | 玩家顯示名稱。 |
lastUpdateSession | Long | 上次工作階段重新整理的 Epoch 毫秒數。 |
map | Boolean | 帳號是否受保護/已加固。 |
loginType() | Int | 存取器: 登入頻道值:1 Facebook、3 Google、4 ZingID、5 Guest、7 Apple、8 Email。 |
loginTypeForTracking() | String | 以字串表示的登入頻道。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userId | String? | 唯一的 VNGGames 用户 id。 |
sessionId | String? | 用于验证后端调用的会话令牌。 |
displayName | String? | 玩家显示名称。 |
lastUpdateSession | Long | 最近一次会话刷新的 Epoch 毫秒数。 |
map | Boolean | 账号是否受保护 / 已加固。 |
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
欄位
字段
| Field | Type | Description |
|---|---|---|
sku | String? | The configured item id from Store. |
price | String? | Store-formatted price string to show the player. |
priceMicros | String? | Price in micro-units, as a string: 1,000,000 = one currency unit. |
currency | String? | ISO currency code. |
| 欄位 | 型別 | 說明 |
|---|---|---|
sku | String? | 在商店設定的商品 id。 |
price | String? | 商店格式化後、用於向玩家顯示的價格字串。 |
priceMicros | String? | 以微單位表示、字串形式的價格: 1,000,000 = 一個 currency 單位。 |
currency | String? | ISO 貨幣代碼。 |
| 字段 | 类型 | 描述 |
|---|---|---|
sku | String? | 在商店配置的商品 id。 |
price | String? | 商店格式化后、用于向玩家展示的价格字符串。 |
priceMicros | String? | 以微单位表示、字符串形式的价格: 1,000,000 = 一个 currency 单位。 |
currency | String? | ISO 货币代码。 |
PaymentInfo
The purchase request passed to Purchase.
傳入「購買」的購買請求。
传入“购买”的购买请求。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
userID | String | Buyer’s VNGGames user id. |
serverID | String | Game server id. |
itemID | String | The configured item id from Store. |
appTransID | String | Your app-side transaction id, for reconciliation. |
addInfo | String | Extra passthrough data. Empty string when unused. |
roleID | String | Character/role id. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | String | 購買者的 VNGGames 使用者 id。 |
serverID | String | 遊戲伺服器 id。 |
itemID | String | 在商店設定的商品 id。 |
appTransID | String | 你在 App 端的交易 id,用於對帳。 |
addInfo | String | 額外的透傳資料。未使用時為空字串。 |
roleID | String | 角色 id。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | String | 购买者的 VNGGames 用户 id。 |
serverID | String | 游戏服务器 id。 |
itemID | String | 在商店配置的商品 id。 |
appTransID | String | 你在 App 端的交易 id,用于对账。 |
addInfo | String | 额外的透传数据。未使用时为空字符串。 |
roleID | String | 角色 id。 |
SocialUserInfo
A social profile returned by the Facebook profile/friends methods.
由 Facebook 個人檔案/好友方法傳回的社群個人檔案。
由 Facebook 资料/好友方法返回的社交资料。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
userID | String? | VNGGames/Facebook user id. |
name | String? | Display name. |
avatarImageURL | String? | Profile picture URL. |
| 欄位 | 型別 | 說明 |
|---|---|---|
userID | String? | VNGGames/Facebook 使用者 id。 |
name | String? | 顯示名稱。 |
avatarImageURL | String? | 個人檔案圖片 URL。 |
| 字段 | 类型 | 描述 |
|---|---|---|
userID | String? | VNGGames/Facebook 用户 id。 |
name | String? | 显示名称。 |
avatarImageURL | String? | 头像图片 URL。 |
SocialFriendType
Audience filter for Invite Facebook friends (enum). The Type column is each case’s name.
「邀請 Facebook 好友」的對象篩選(列舉)。Type 欄位為各項目的名稱。
“邀请 Facebook 好友”的受众筛选(枚举)。Type 列为各项的名称。
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
.ALL_USERS | ALL_USERS | All friends. |
.APP_USERS | APP_USERS | Friends who already use the app. |
.APP_NON_USERS | APP_NON_USERS | Friends who don’t use the app. |
| 欄位 | 型別 | 說明 |
|---|---|---|
.ALL_USERS | ALL_USERS | 所有好友。 |
.APP_USERS | APP_USERS | 已在使用此應用程式的好友。 |
.APP_NON_USERS | APP_NON_USERS | 尚未使用此應用程式的好友。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.ALL_USERS | ALL_USERS | 所有好友。 |
.APP_USERS | APP_USERS | 已在使用该应用的好友。 |
.APP_NON_USERS | APP_NON_USERS | 尚未使用该应用的好友。 |
InviteFriendsSocialType
The invite request passed to Invite Facebook friends. Variant .Facebook(message, friendType):
傳入「邀請 Facebook 好友」的邀請請求。變體 .Facebook(message, friendType):
传入“邀请 Facebook 好友”的邀请请求。变体 .Facebook(message, friendType):
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
message | String | Invite message shown in the dialog. |
friendType | SocialFriendType | Audience filter: see SocialFriendType. |
| 欄位 | 型別 | 說明 |
|---|---|---|
message | String | 在對話框中顯示的邀請訊息。 |
friendType | SocialFriendType | 對象篩選: 請參閱 SocialFriendType。 |
| 字段 | 类型 | 描述 |
|---|---|---|
message | String | 在对话框中显示的邀请消息。 |
friendType | SocialFriendType | 受众筛选: 请参阅 SocialFriendType。 |
GetFriendsSocialType
The friends query passed to Get Facebook friends. Variant .Facebook(offset, count):
傳入「取得 Facebook 好友」的好友查詢。變體 .Facebook(offset, count):
传入“获取 Facebook 好友”的好友查询。变体 .Facebook(offset, count):
Fields
欄位
字段
| Field | Type | Description |
|---|---|---|
offset | Int | Paging offset. |
count | Int | Number of friends to fetch. |
| 欄位 | 型別 | 說明 |
|---|---|---|
offset | Int | 分頁偏移量。 |
count | Int | 要取得的好友數量。 |
| 字段 | 类型 | 描述 |
|---|---|---|
offset | Int | 分页偏移量。 |
count | Int | 要获取的好友数量。 |
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
欄位
字段
| Field | Type | Description |
|---|---|---|
.FacebookPhoto | ShareType.FacebookPhoto | Share a photo to Facebook: supply the image as a Uri or a Bitmap. |
.FacebookPhoto.title | String? | Optional caption/title. |
.FacebookPhoto.imageURI | Uri? | Photo to share, as a content Uri (android.net.Uri): primary constructor. |
.FacebookPhoto.bitmap | Bitmap? | Photo to share, as a Bitmap (android.graphics.Bitmap): alternate constructor, converted to a Uri internally. |
.FacebookLink | ShareType.FacebookLink | Share a link to Facebook. |
.FacebookLink.title | String? | Link title. |
.FacebookLink.description | String? | Link description. |
.FacebookLink.redirectLink | String? | URL to share. |
.FacebookLink.imageURL | String? | Optional preview image URL. |
.InstagramPhotoFeed | ShareType.InstagramPhotoFeed | Share an image to the Instagram feed. |
.InstagramPhotoFeed.imageURI | Uri? | Image to share (android.net.Uri). |
.InstagramPhotoStory | ShareType.InstagramPhotoStory | Share an image to Instagram Stories. |
.InstagramPhotoStory.imageURI | Uri? | Image to share (android.net.Uri). |
| 欄位 | 型別 | 說明 |
|---|---|---|
.FacebookPhoto | ShareType.FacebookPhoto | 分享相片到 Facebook: 以 Uri 或 Bitmap 提供圖片。 |
.FacebookPhoto.title | String? | 選填的說明/標題。 |
.FacebookPhoto.imageURI | Uri? | 要分享的相片,以 content Uri(android.net.Uri)表示: 主要建構式。 |
.FacebookPhoto.bitmap | Bitmap? | 要分享的相片,以 Bitmap(android.graphics.Bitmap)表示: 替代建構式。會在內部轉換為 Uri。 |
.FacebookLink | ShareType.FacebookLink | 分享連結到 Facebook。 |
.FacebookLink.title | String? | 連結標題。 |
.FacebookLink.description | String? | 連結說明。 |
.FacebookLink.redirectLink | String? | 要分享的 URL。 |
.FacebookLink.imageURL | String? | 選填的預覽圖片 URL。 |
.InstagramPhotoFeed | ShareType.InstagramPhotoFeed | 分享圖片到 Instagram 動態。 |
.InstagramPhotoFeed.imageURI | Uri? | 要分享的圖片(android.net.Uri)。 |
.InstagramPhotoStory | ShareType.InstagramPhotoStory | 分享圖片到 Instagram 限時動態。 |
.InstagramPhotoStory.imageURI | Uri? | 要分享的圖片(android.net.Uri)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
.FacebookPhoto | ShareType.FacebookPhoto | 分享照片到 Facebook: 以 Uri 或 Bitmap 提供图片。 |
.FacebookPhoto.title | String? | 可选的说明/标题。 |
.FacebookPhoto.imageURI | Uri? | 要分享的照片,以 content Uri(android.net.Uri)表示: 主构造函数。 |
.FacebookPhoto.bitmap | Bitmap? | 要分享的照片,以 Bitmap(android.graphics.Bitmap)表示: 备用构造函数。会在内部转换为 Uri。 |
.FacebookLink | ShareType.FacebookLink | 分享链接到 Facebook。 |
.FacebookLink.title | String? | 链接标题。 |
.FacebookLink.description | String? | 链接描述。 |
.FacebookLink.redirectLink | String? | 要分享的 URL。 |
.FacebookLink.imageURL | String? | 可选的预览图片 URL。 |
.InstagramPhotoFeed | ShareType.InstagramPhotoFeed | 分享图片到 Instagram 动态。 |
.InstagramPhotoFeed.imageURI | Uri? | 要分享的图片(android.net.Uri)。 |
.InstagramPhotoStory | ShareType.InstagramPhotoStory | 分享图片到 Instagram 快拍。 |
.InstagramPhotoStory.imageURI | Uri? | 要分享的图片(android.net.Uri)。 |
Error Codes
Failures arrive as an error on domain net.vnggames.sdk (PassError), banded by source. Each row is one code: Field = numeric error.code, Type = the symbol. Note: for the mapped auth/payment bands the SDK band number is shown in the message while error.code preserves the upstream server value.
失敗會以網域 net.vnggames.sdk 上的錯誤(PassError)傳回,並依來源分段。每一列代表一個錯誤碼: Field=數值 error.code,Type=該符號。注意:對於已對應的驗證/付款分段,訊息中會顯示 SDK 分段編號,而 error.code 則保留上游伺服器的值。
失败以域为 net.vnggames.sdk(PassError)的错误形式返回,按来源分段。每一行是一个错误码: Field = 数值 error.code,Type = 符号。注意:对于经过映射的验证 / 支付段,消息中显示的是 SDK 段号,而 error.code 保留上游服务器的原始值。
Auth: VGA / OAuth (7xxx)
VGA (VNGGames Account) / OAuth login errors, delivered as an error. These back the VGA login flows. iOS/Android differ: both share the 7005 to 7020 OAuth codes, but elsewhere the endpoints diverge: on Android user-cancel is 7002 (USER_CANCEL, the legacy build flavor reports 9003 on its cancel-login path), 7003 is LOGIN_FAILED, and 7021 is account-already-bound (QUICK_LOGIN_ACCOUNT_BOUND). iOS instead uses 7001 for cancel and 7021 for validateAccessTokenNullResult, and defines 7022 至 7027 (null-result and quick-login cases) that Android does not.
VGA(VNGGames Account)/OAuth 登入錯誤,以錯誤傳回。這些支撐 VGA 登入流程。iOS 與 Android 有差異:兩者共用 7005 至 7020 的 OAuth 代碼,但其他端點有所分歧: 在 Android 上,玩家取消為 7002(USER_CANCEL,legacy 建置風味在其取消登入路徑回報 9003),7003 為 LOGIN_FAILED,而 7021 為帳號已綁定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 則以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,並定義了 Android 沒有的 7022 至 7027(未傳回結果與快速登入的情形)。
VGA(VNGGames Account)/ OAuth 登录错误,以错误形式返回。它们支撑 VGA 登录流程。iOS 与 Android 存在差异:两者共用 7005 至 7020 的 OAuth 代码,但其他端点有所分歧: 在 Android 上,玩家取消为 7002(USER_CANCEL,legacy 构建风味在其取消登录路径返回 9003),7003 为 LOGIN_FAILED,而 7021 为账号已绑定(QUICK_LOGIN_ACCOUNT_BOUND)。iOS 则以 7001 表示取消、以 7021 表示 validateAccessTokenNullResult,并定义了 Android 没有的 7022 至 7027(未返回结果与快速登录的情形)。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
7000 | undefined | Unmapped GGID / OAuth error (fallback). |
7001 | cancelLogin | Player canceled login. |
7005 | invalidRequest | OAuth invalid_request. |
7006 | invalidClient | OAuth invalid_client. |
7007 | invalidGrant | OAuth invalid_grant. |
7008 | invalidScope | OAuth invalid_scope. |
7009 | unsupportedResponseType | OAuth unsupported_response_type. |
7010 | unsupportedGrantType | OAuth unsupported_grant_type. |
7011 | unauthorizedClient | OAuth unauthorized_client. |
7012 | unauthorizedCode | OAuth unauthorized_code. |
7013 | unauthorizedToken | OAuth unauthorized_token. |
7014 | expiredAccessToken | Access token expired. |
7015 | expiredRefreshToken | Refresh token expired. |
7016 | inactiveAccessToken | Access token inactive. |
7017 | accessDenied | Access denied. |
7018 | serverError | OAuth server_error. |
7019 | internalError | OAuth internal_error. |
7020 | invalidUserCredentials | Invalid user credentials. |
7021 | validateAccessTokenNullResult | iOS: token validation returned no result. On Android, 7021 is QUICK_LOGIN_ACCOUNT_BOUND (see the platform note above). |
7022 | refreshAccessTokenNullResult | Token refresh returned no result. |
7023 | getProfileNullResult | Profile fetch returned no result. |
7024 | authenticateNullResult | Authentication returned no result. |
7025 | quickLoginAccountBound | iOS only: the guest account is already bound to a VGA account. Android maps this case to 7021. |
7026 | quickLoginRequiredBinding | Binding is required: the user must bind their account (no skip option). |
7027 | quickLoginTurnOff | Quick login is disabled. The standard login options are shown instead. |
| 欄位 | 型別 | 說明 |
|---|---|---|
7000 | undefined | 未對應的 GGID/OAuth 錯誤(備用)。 |
7001 | cancelLogin | 玩家取消登入。 |
7005 | invalidRequest | OAuth invalid_request。 |
7006 | invalidClient | OAuth invalid_client。 |
7007 | invalidGrant | OAuth invalid_grant。 |
7008 | invalidScope | OAuth invalid_scope。 |
7009 | unsupportedResponseType | OAuth unsupported_response_type。 |
7010 | unsupportedGrantType | OAuth unsupported_grant_type。 |
7011 | unauthorizedClient | OAuth unauthorized_client。 |
7012 | unauthorizedCode | OAuth unauthorized_code。 |
7013 | unauthorizedToken | OAuth unauthorized_token。 |
7014 | expiredAccessToken | 存取權杖已過期。 |
7015 | expiredRefreshToken | 重新整理權杖已過期。 |
7016 | inactiveAccessToken | 存取權杖未啟用。 |
7017 | accessDenied | 存取遭拒。 |
7018 | serverError | OAuth server_error。 |
7019 | internalError | OAuth internal_error。 |
7020 | invalidUserCredentials | 使用者憑證無效。 |
7021 | validateAccessTokenNullResult | iOS: 權杖驗證未傳回任何結果。在 Android 上,7021 為 QUICK_LOGIN_ACCOUNT_BOUND(見上方平台說明)。 |
7022 | refreshAccessTokenNullResult | 權杖重新整理未傳回任何結果。 |
7023 | getProfileNullResult | 個人檔案取得未傳回任何結果。 |
7024 | authenticateNullResult | 身分驗證未傳回任何結果。 |
7025 | quickLoginAccountBound | 僅 iOS: 此訪客帳號已綁定到某個 VGA 帳號。Android 將此情形對應為 7021。 |
7026 | quickLoginRequiredBinding | 必須綁定: 使用者必須綁定其帳號(無略過選項)。 |
7027 | quickLoginTurnOff | 快速登入已停用。改為顯示標準登入選項。 |
| 字段 | 类型 | 描述 |
|---|---|---|
7000 | undefined | 未映射的 GGID / OAuth 错误(兜底)。 |
7001 | cancelLogin | 玩家取消了登录。 |
7005 | invalidRequest | OAuth invalid_request 错误。 |
7006 | invalidClient | OAuth invalid_client 错误。 |
7007 | invalidGrant | OAuth invalid_grant 错误。 |
7008 | invalidScope | OAuth invalid_scope 错误。 |
7009 | unsupportedResponseType | OAuth unsupported_response_type 错误。 |
7010 | unsupportedGrantType | OAuth unsupported_grant_type 错误。 |
7011 | unauthorizedClient | OAuth unauthorized_client 错误。 |
7012 | unauthorizedCode | OAuth unauthorized_code 错误。 |
7013 | unauthorizedToken | OAuth unauthorized_token 错误。 |
7014 | expiredAccessToken | 访问令牌已过期。 |
7015 | expiredRefreshToken | 刷新令牌已过期。 |
7016 | inactiveAccessToken | 访问令牌未激活。 |
7017 | accessDenied | 访问被拒绝。 |
7018 | serverError | OAuth server_error。 |
7019 | internalError | OAuth internal_error。 |
7020 | invalidUserCredentials | 用户凭据无效。 |
7021 | validateAccessTokenNullResult | iOS: 令牌验证未返回结果。在 Android 上,7021 为 QUICK_LOGIN_ACCOUNT_BOUND(见上方平台说明)。 |
7022 | refreshAccessTokenNullResult | 令牌刷新未返回结果。 |
7023 | getProfileNullResult | 资料获取未返回结果。 |
7024 | authenticateNullResult | 身份验证未返回结果。 |
7025 | quickLoginAccountBound | 仅 iOS: 该访客账号已绑定到某个 VGA 账号。Android 将此情形映射为 7021。 |
7026 | quickLoginRequiredBinding | 必须绑定: 用户必须绑定其账号(无跳过选项)。 |
7027 | quickLoginTurnOff | 快速登录已禁用。改为显示标准登录选项。 |
Auth: Passport legacy (8xxx)
Passport-legacy login errors. The SDK maps each Passport server return code to an 8xxx value (8000 = unknown fallback). error.code carries the 8xxx band while the original server code is in the message. Type = the source Passport server return code.
Passport legacy 登入錯誤。SDK 會將每個 Passport 伺服器回傳碼對應到一個 8xxx 值(8000=未知備用)。error.code 帶有 8xxx 分段,而原始伺服器碼則在訊息中。Type=來源 Passport 伺服器回傳碼。
Passport 旧版登录错误。SDK 将每个 Passport 服务器返回码映射为一个 8xxx 值(8000 = 未知兜底)。error.code 携带 8xxx 段,而原始服务器码在消息中。Type = 来源 Passport 服务器返回码。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
8000 | unknown | Unknown Passport-legacy login error (fallback). |
8001 | 1 | Success (server returned code 1). |
8002 | -500 | System error: inspect server logs. |
8003 | -404 | Invalid request (client called the wrong URL). |
8004 | -1 | Bad signature. |
8005 | -2 | Bad request parameters. |
8006 | -101 | Email is already registered. |
8007 | -102 | Email already in use (guest protection). |
8008 | -103 | Email does not exist (forgot / reset password). |
8009 | -104 | UserID is already protected. |
8010 | -105 | UserID not found (account disabled / deleted). |
8011 | -106 | Invalid login credentials. |
8012 | -107 | Invalid login credentials (profile mismatch / null). |
8013 | -108 | Invalid or expired session. |
8014 | -109 | Under the minimum age allowed to play. |
8015 | -110 | Account initialization failed. |
8016 | -111 | User is not in the early-access allow list. |
8017 | -112 | Account is locked. |
8018 | -113 | Account profile is incomplete. |
| 欄位 | 型別 | 說明 |
|---|---|---|
8000 | unknown | 未知的 Passport legacy 登入錯誤(備用)。 |
8001 | 1 | 成功(伺服器回傳碼 1)。 |
8002 | -500 | 系統錯誤: 請檢查伺服器記錄。 |
8003 | -404 | 無效的請求(用戶端呼叫了錯誤的 URL)。 |
8004 | -1 | 簽章錯誤。 |
8005 | -2 | 請求參數錯誤。 |
8006 | -101 | 電子郵件已註冊。 |
8007 | -102 | 電子郵件已被使用(訪客保護)。 |
8008 | -103 | 電子郵件不存在(忘記/重設密碼)。 |
8009 | -104 | UserID 已受保護。 |
8010 | -105 | 找不到 UserID(帳號已停用/已刪除)。 |
8011 | -106 | 登入憑證無效。 |
8012 | -107 | 登入憑證無效(個人檔案不符/為 null)。 |
8013 | -108 | 工作階段無效或已過期。 |
8014 | -109 | 未達允許遊玩的最低年齡。 |
8015 | -110 | 帳號初始化失敗。 |
8016 | -111 | 使用者不在搶先體驗的允許清單中。 |
8017 | -112 | 帳號已鎖定。 |
8018 | -113 | 帳號個人檔案不完整。 |
| 字段 | 类型 | 描述 |
|---|---|---|
8000 | unknown | 未知的 Passport 旧版登录错误(兜底)。 |
8001 | 1 | 成功(服务器返回码 1)。 |
8002 | -500 | 系统错误: 请检查服务器日志。 |
8003 | -404 | 请求无效(客户端调用了错误的 URL)。 |
8004 | -1 | 签名错误。 |
8005 | -2 | 请求参数错误。 |
8006 | -101 | 邮箱已被注册。 |
8007 | -102 | 邮箱已被使用(访客保护)。 |
8008 | -103 | 邮箱不存在(忘记 / 重置密码)。 |
8009 | -104 | UserID 已受保护。 |
8010 | -105 | 找不到 UserID(账号已禁用 / 删除)。 |
8011 | -106 | 登录凭据无效。 |
8012 | -107 | 登录凭据无效(资料不匹配 / 为空)。 |
8013 | -108 | 会话无效或已过期。 |
8014 | -109 | 未达到允许游玩的最低年龄。 |
8015 | -110 | 账号初始化失败。 |
8016 | -111 | 用户不在抢先体验白名单中。 |
8017 | -112 | 账号已被锁定。 |
8018 | -113 | 账号资料不完整。 |
Payment: billing server (6xxx)
Billing-server errors. The SDK maps each payment server return code to a 6xxx value (6000 = unknown fallback). Type = the source payment server code.
帳務伺服器錯誤。SDK 會將每個付款伺服器回傳碼對應到一個 6xxx 值(6000=未知備用)。Type=來源付款伺服器碼。
计费服务器错误。SDK 将每个支付服务器返回码映射为一个 6xxx 值(6000 = 未知兜底)。Type = 来源支付服务器码。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
6000 | unknown | Unknown billing-server error (fallback). |
6001 | 1 | Success (server returned code 1). |
6002 | -8 | System under maintenance (any payment-system error maps here). |
6003 | -70 | Payment error (uncategorized IAP pay failure). |
6004 | -71 | Invalid receipt (bad signature or mismatched package / product / order). |
6005 | -72 | Duplicate receipt (already verified successfully). |
6006 | -73 | Expired receipt (older than 72 hours). |
| 欄位 | 型別 | 說明 |
|---|---|---|
6000 | unknown | 未知的帳務伺服器錯誤(備用)。 |
6001 | 1 | 成功(伺服器回傳碼 1)。 |
6002 | -8 | 系統維護中(任何付款系統錯誤都對應到此)。 |
6003 | -70 | 付款錯誤(未分類的 IAP 付款失敗)。 |
6004 | -71 | 收據無效(簽章錯誤或 package/product/order 不符)。 |
6005 | -72 | 重複的收據(已成功驗證過)。 |
6006 | -73 | 收據已過期(超過 72 小時)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
6000 | unknown | 未知的计费服务器错误(兜底)。 |
6001 | 1 | 成功(服务器返回码 1)。 |
6002 | -8 | 系统维护中(任何支付系统错误都映射到此)。 |
6003 | -70 | 支付错误(未分类的 IAP 支付失败)。 |
6004 | -71 | 收据无效(签名错误或 package / product / order 不匹配)。 |
6005 | -72 | 收据重复(已成功验证过)。 |
6006 | -73 | 收据已过期(超过 72 小时)。 |
Payment: store / verification (9xxx)
Store, receipt, and verification errors raised during the purchase flow (9xxx client-side band). iOS and Android differ: both are merged here, so the same code number can carry a different meaning on each platform. Type shows the source symbol(s) (iOS / Android).
在購買流程期間引發的商店、收據與驗證錯誤(9xxx 用戶端分段)。iOS 與 Android 有所不同: 此處合併列出,同一組代碼在不同平台上可能代表不同含義。Type 欄顯示來源符號(iOS/Android)。
在购买流程中引发的商店、收据与验证错误(9xxx 客户端段)。iOS 与 Android 有所不同: 此处合并列出,同一组代码在不同平台上可能代表不同含义。Type 列显示来源符号(iOS / Android)。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
9006 | paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEM | iOS: the purchase info is invalid. Android: product not found on the pre-purchase inventory check. |
9007 | paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM | Product id not found. |
9008 | paymentVerificationInProgress / ITEM_IS_VERIFYING | A verification is already in progress. |
9009 | paymentCanceled / PAYMENT_CANCEL | Player canceled the purchase. |
9010 | NOT_SIGN_IN_GOOGLE_PLAY | Android: the player is not signed in to Google Play. |
9011 | NOT_REGISTER_ITEM | Android: the item / reward package is not registered. |
9012 | HAS_SUBSCRIPTION | Android: the player already owns an active subscription for this item. |
9013 | PRODUCT_IS_PENDING | Android: the purchase is pending (not yet completed). |
9014 | PURCHASE_FAILED_WITH_BILLING_ERROR | Android: purchase failed due to a Google Play billing error. |
9015 | PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LIST | Android: purchase failed. The returned purchase list did not contain the item. |
9016 | paymentRetrieveAppleReceiptFailed | iOS: could not read the App Store receipt. |
9017 | paymentOrderDataInvalid | iOS: the order data is invalid. |
9049 | paymentPending | iOS: the purchase is pending approval (deferred / Ask-to-Buy). |
| 欄位 | 型別 | 說明 |
|---|---|---|
9006 | paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEM | iOS: 購買資訊無效。Android: 購買前查詢庫存時找不到該商品。 |
9007 | paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM | 找不到商品 ID。 |
9008 | paymentVerificationInProgress / ITEM_IS_VERIFYING | 已有一項驗證正在進行中。 |
9009 | paymentCanceled / PAYMENT_CANCEL | 玩家取消了購買。 |
9010 | NOT_SIGN_IN_GOOGLE_PLAY | Android: 尚未登入 Google Play。 |
9011 | NOT_REGISTER_ITEM | Android: 道具/獎勵包未註冊。 |
9012 | HAS_SUBSCRIPTION | Android: 已擁有此項目的有效訂閱。 |
9013 | PRODUCT_IS_PENDING | Android: 購買處於待處理狀態(尚未完成)。 |
9014 | PURCHASE_FAILED_WITH_BILLING_ERROR | Android: 因 Google Play 帳務錯誤導致購買失敗。 |
9015 | PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LIST | Android: 購買失敗。回傳的購買清單未包含該項目。 |
9016 | paymentRetrieveAppleReceiptFailed | iOS: 無法讀取 App Store 收據。 |
9017 | paymentOrderDataInvalid | iOS: 訂單資料無效。 |
9049 | paymentPending | iOS: 購買正等待核准(延遲/需家長同意)。 |
| 字段 | 类型 | 描述 |
|---|---|---|
9006 | paymentInfoInvalid / ITEM_NOT_FOUND_CHECK_ITEM | iOS: 购买信息无效。Android: 购买前查询库存时找不到该商品。 |
9007 | paymentProductNotFound / ITEM_NOT_FOUND_PURCHASE_ITEM | 找不到商品 id。 |
9008 | paymentVerificationInProgress / ITEM_IS_VERIFYING | 已有一个验证正在进行中。 |
9009 | paymentCanceled / PAYMENT_CANCEL | 玩家取消了购买。 |
9010 | NOT_SIGN_IN_GOOGLE_PLAY | Android: 尚未登录 Google Play。 |
9011 | NOT_REGISTER_ITEM | Android: 道具 / 奖励包未注册。 |
9012 | HAS_SUBSCRIPTION | Android: 已拥有此项目的有效订阅。 |
9013 | PRODUCT_IS_PENDING | Android: 购买处于待处理状态(尚未完成)。 |
9014 | PURCHASE_FAILED_WITH_BILLING_ERROR | Android: 因 Google Play 结算错误导致购买失败。 |
9015 | PURCHASE_FAILED_NOT_CONTAIN_PURCHASE_LIST | Android: 购买失败。返回的购买列表未包含该商品。 |
9016 | paymentRetrieveAppleReceiptFailed | iOS: 无法读取 App Store 收据。 |
9017 | paymentOrderDataInvalid | iOS: 订单数据无效。 |
9049 | paymentPending | iOS: 购买正在等待批准(延迟 / 需家长同意)。 |
Social (9xxx)
Facebook and Instagram profile / share / invite failures.
Facebook 與 Instagram 的個人檔案/分享/邀請失敗。
Facebook 与 Instagram 的资料 / 分享 / 邀请失败。
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
9024 | facebookGetProfileNullResult | Facebook profile fetch returned no result. |
9026 | facebookShareEmptyPhoto | No photo supplied to share. |
9027 | facebookAppNotInstalled | Facebook app is not installed. |
9028 | facebookShareEmptyLink | No link supplied to share. |
9029 | facebookInviteFriendTitleAndMessageEmpty | Invite title and message are both empty. |
9030 | facebookShareCanceled | Player canceled the share. |
9031 | facebookInviteFriendCanceled | Player canceled the invite. |
9032 | instagramAppNotInstalled | Instagram app is not installed. |
9033 | instagramPhotoLibraryNotAllowed | Photo-library access not granted. |
9034 | instagramShareEmptyPhoto | No photo supplied to share. |
9035 | facebookUnsupported | Facebook feature not enabled in this build. |
9038 | instagramUnsupported | Instagram feature not enabled in this build. |
| 欄位 | 型別 | 說明 |
|---|---|---|
9024 | facebookGetProfileNullResult | Facebook 個人檔案取得未傳回任何結果。 |
9026 | facebookShareEmptyPhoto | 未提供要分享的相片。 |
9027 | facebookAppNotInstalled | 未安裝 Facebook 應用程式。 |
9028 | facebookShareEmptyLink | 未提供要分享的連結。 |
9029 | facebookInviteFriendTitleAndMessageEmpty | 邀請的標題與訊息皆為空。 |
9030 | facebookShareCanceled | 玩家取消了分享。 |
9031 | facebookInviteFriendCanceled | 玩家取消了邀請。 |
9032 | instagramAppNotInstalled | 未安裝 Instagram 應用程式。 |
9033 | instagramPhotoLibraryNotAllowed | 未授予相片庫存取權。 |
9034 | instagramShareEmptyPhoto | 未提供要分享的相片。 |
9035 | facebookUnsupported | 此版本未啟用 Facebook 功能。 |
9038 | instagramUnsupported | 此版本未啟用 Instagram 功能。 |
| 字段 | 类型 | 描述 |
|---|---|---|
9024 | facebookGetProfileNullResult | Facebook 资料获取未返回结果。 |
9026 | facebookShareEmptyPhoto | 未提供要分享的照片。 |
9027 | facebookAppNotInstalled | 未安装 Facebook 应用。 |
9028 | facebookShareEmptyLink | 未提供要分享的链接。 |
9029 | facebookInviteFriendTitleAndMessageEmpty | 邀请标题和消息均为空。 |
9030 | facebookShareCanceled | 玩家取消了分享。 |
9031 | facebookInviteFriendCanceled | 玩家取消了邀请。 |
9032 | instagramAppNotInstalled | 未安装 Instagram 应用。 |
9033 | instagramPhotoLibraryNotAllowed | 未授予相册访问权限。 |
9034 | instagramShareEmptyPhoto | 未提供要分享的照片。 |
9035 | facebookUnsupported | 此构建版本未启用 Facebook 功能。 |
9038 | instagramUnsupported | 此构建版本未启用 Instagram 功能。 |
General & availability (9xxx)
Cross-cutting client errors any flow can surface, plus feature-availability sentinels. Customer support surfaces an error with the string code invalid_payload. (Reserved/unused: 9004, and 9010 to 9015.)
任何流程都可能出現的橫切用戶端錯誤,以及功能可用性的哨符值。客戶支援會以字串碼 invalid_payload 呈現一個錯誤。(保留/未使用:9004、9010 至 9015)
任何流程都可能暴露的横切客户端错误,以及功能可用性哨兵值。客户支持会以字符串码 invalid_payload 暴露一个错误。(保留 / 未使用:9004、9010 至 9015)
Codes
錯誤碼
错误码
| Field | Type | Description |
|---|---|---|
9000 | undefined | Undefined / unknown error. |
9001 | networkFailed | Network request failed (retryable). |
9002 | wrongDataFormat | Malformed response data. |
9003 | cancelLogin | Login canceled (SDK band). |
9005 | googleRefreshTokenFailed | Google token refresh failed. |
9018 | appleCredentialNotFoundInAuthorizationResult | Apple authorization returned no credential. |
9019 | googleConfigNotFound | Google config missing. |
9020 | facebookConfigNotFound | Facebook config missing. |
9021 | appleTwoAuthenticationError | Sign in with Apple 2FA error. |
9022 | appleCancelError | Player canceled Sign in with Apple. |
9023 | appleOtherError | Other Sign in with Apple error. |
9025 | appleCachedCredentialNotFound | No cached Apple credential. |
9036 | googleUnsupported | Google login not enabled in this build. |
9037 | vgaUnsupported | VGA login not enabled in this build. |
9047 | firebaseUnsupported | Firebase not enabled in this build. |
| 欄位 | 型別 | 說明 |
|---|---|---|
9000 | undefined | 未定義/未知的錯誤。 |
9001 | networkFailed | 網路請求失敗(可重試)。 |
9002 | wrongDataFormat | 回應資料格式錯誤。 |
9003 | cancelLogin | 登入已取消(SDK 分段)。 |
9005 | googleRefreshTokenFailed | Google 權杖重新整理失敗。 |
9018 | appleCredentialNotFoundInAuthorizationResult | Apple 授權未傳回任何憑證。 |
9019 | googleConfigNotFound | 缺少 Google 設定。 |
9020 | facebookConfigNotFound | 缺少 Facebook 設定。 |
9021 | appleTwoAuthenticationError | 使用 Apple 登入的兩階段驗證錯誤。 |
9022 | appleCancelError | 玩家取消了使用 Apple 登入。 |
9023 | appleOtherError | 其他使用 Apple 登入的錯誤。 |
9025 | appleCachedCredentialNotFound | 沒有快取的 Apple 憑證。 |
9036 | googleUnsupported | 此版本未啟用 Google 登入。 |
9037 | vgaUnsupported | 此版本未啟用 VGA 登入。 |
9047 | firebaseUnsupported | 此版本未啟用 Firebase。 |
| 字段 | 类型 | 描述 |
|---|---|---|
9000 | undefined | 未定义 / 未知错误。 |
9001 | networkFailed | 网络请求失败(可重试)。 |
9002 | wrongDataFormat | 响应数据格式错误。 |
9003 | cancelLogin | 登录已取消(SDK 段)。 |
9005 | googleRefreshTokenFailed | Google 令牌刷新失败。 |
9018 | appleCredentialNotFoundInAuthorizationResult | Apple 授权未返回凭据。 |
9019 | googleConfigNotFound | 缺少 Google 配置。 |
9020 | facebookConfigNotFound | 缺少 Facebook 配置。 |
9021 | appleTwoAuthenticationError | Sign in with Apple 双重验证(2FA)错误。 |
9022 | appleCancelError | 玩家取消了 Sign in with Apple。 |
9023 | appleOtherError | 其他 Sign in with Apple 错误。 |
9025 | appleCachedCredentialNotFound | 没有缓存的 Apple 凭据。 |
9036 | googleUnsupported | 此构建版本未启用 Google 登录。 |
9037 | vgaUnsupported | 此构建版本未启用 VGA 登录。 |
9047 | firebaseUnsupported | 此构建版本未启用 Firebase。 |