iOS 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

Integrate the VNGGames SDK for iOS. Complete the prerequisites, then install either with Swift Package Manager or manually. Follow the steps for your chosen method below.

整合 iOS 版 VNGGames SDK。請先完成先決條件,然後選擇以 Swift Package Manager手動方式安裝,再依照下方所選方式的步驟操作。

集成 iOS 版 VNGGames SDK。请先完成前提条件,然后选择以 Swift Package Manager手动方式安装,再按照下方所选方式的步骤操作。

Prerequisites

  • VNGGames SDK package: obtain the latest VNGGames SDK zip file.
  • Xcode: version 26 or later. Use the iOS / iPadOS SDK that ships with it.
  • Minimum iOS version: iOS 13.
  • Device support: physical devices and the Simulator.
  • Configuration files: VGSDKService-Info.plist, VGSDKIronSource-Info.plist, and GoogleService-Info.plist.
  • VNGGames SDK 套件: 取得最新的 VNGGames SDK zip 檔案。
  • Xcode: 版本 26 或以上。使用其隨附的 iOS / iPadOS SDK。
  • 最低 iOS 版本: iOS 13。
  • 裝置支援: 實體裝置與模擬器。
  • 設定檔: VGSDKService-Info.plistVGSDKIronSource-Info.plistGoogleService-Info.plist
  • VNGGames SDK 包: 获取最新的 VNGGames SDK zip 文件。
  • Xcode: 版本 26 或更高。使用其随附的 iOS / iPadOS SDK。
  • 最低 iOS 版本: iOS 13。
  • 设备支持: 物理设备与模拟器。
  • 配置文件: VGSDKService-Info.plistVGSDKIronSource-Info.plistGoogleService-Info.plist

Dependencies

Every third-party library the SDK brings into your build. Swift Package Manager resolves them when you add the VNGGames SDK package, and the SDK links all of them whatever your game enabled. Check this list before adding any of these libraries yourself.

SDK 帶進你建置中的所有第三方函式庫。當你加入 VNGGames SDK 套件時,Swift Package Manager 會一併解析它們,而且無論你的遊戲啟用了哪些功能,SDK 都會全部連結。在自行加入這些函式庫之前請先查看本清單。

SDK 带进你构建中的所有第三方库。当你加入 VNGGames SDK 包时,Swift Package Manager 会一并解析它们,而且无论你的游戏启用了哪些功能,SDK 都会全部链接。在自行加入这些库之前请先查看本清单。

Never add IronSource, UnityAds, AppsFlyer, or Firebase Crashlytics as separate frameworks. They are statically baked into PassSDK.xcframework. Adding any of them again double-links the same archive and causes a duplicate-symbol / duplicate-class crash.

切勿將 IronSource、UnityAds、AppsFlyer 或 Firebase Crashlytics 另外當作獨立 framework 加入。 它們已靜態合併進 PassSDK.xcframework。再次加入其中任何一個都會重複連結同一份封存檔,導致重複符號/重複類別(duplicate-symbol / duplicate-class)當機

切勿将 IronSource、UnityAds、AppsFlyer 或 Firebase Crashlytics 另外当作独立 framework 添加。 它们已静态合并进 PassSDK.xcframework。再次添加其中任何一个都会重复链接同一份归档,导致重复符号/重复类别(duplicate-symbol / duplicate-class)崩溃

LibraryVersionGroup
Reachability3.7.7Core
KeychainAccess4.2.2Core
SwiftCentrifuge0.8.2Core
FirebaseCore11.15.0Core
FirebaseInstallations11.15.0Core
FirebaseCrashlytics11.15.0Core
FirebaseCoreInternal11.15.0Core
FirebaseSharedSwift11.15.0Core
GoogleUtilities8.1.0Core
GoogleDataTransport10.1.0Core
nanopb2.30910.0Core
FBLPromises2.4.0Core
AppCheckCore11.2.0Core
SwiftProtobuf1.38.0Core
FBSDKCoreKit18.0.3Login channels
FBSDKCoreKit_Basics18.0.3Login channels
FBAEMKit18.0.3Login channels
FBSDKLoginKit18.0.3Login channels
GoogleSignIn8.0.0Login channels
AppAuth1.7.6Login channels
GTMAppAuth4.1.1Login channels
GTMSessionFetcher3.5.0Login channels
AppsFlyerLib6.17.9Analytics
FirebaseAnalytics11.15.0Analytics
ThinkingSDK3.4.0Analytics
ThinkingDataCore1.3.3Analytics
GoogleAdsOnDeviceConversion2.1.0Analytics
GoogleAppMeasurement11.15.0Analytics
FBSDKShareKit18.0.3Social
FBSDKGamingServicesKit18.0.3Social
IronSource8.3.0In-App Ads
IronSourceAdQualitySDK7.21.0In-App Ads
IASDKCore8.3.1In-App Ads
ISFacebookAdapter4.3.46In-App Ads
ISFyberAdapter4.3.36.2In-App Ads
ISAdMobAdapter4.3.57In-App Ads
ISUnityAdsAdapter4.3.43In-App Ads
UnityAds4.16.1In-App Ads
GoogleMobileAds11.10.0In-App Ads
FBAudienceNetwork6.21.1In-App Ads
GoogleUserMessagingPlatform2.7.0In-App Ads
CleverTapSDK7.7.0Engage
CTNotificationService0.1.7Engage
CTNotificationContent1.3.0Engage
FirebaseMessaging11.15.0Engage
FirebaseRemoteConfig11.15.0Engage
FirebaseInAppMessaging11.15.0Engage
FirebaseABTesting11.15.0Engage
FirebaseRemoteConfigInterop11.15.0Engage
SDWebImage5.21.0Engage
函式庫版本分組
Reachability3.7.7核心
KeychainAccess4.2.2核心
SwiftCentrifuge0.8.2核心
FirebaseCore11.15.0核心
FirebaseInstallations11.15.0核心
FirebaseCrashlytics11.15.0核心
FirebaseCoreInternal11.15.0核心
FirebaseSharedSwift11.15.0核心
GoogleUtilities8.1.0核心
GoogleDataTransport10.1.0核心
nanopb2.30910.0核心
FBLPromises2.4.0核心
AppCheckCore11.2.0核心
SwiftProtobuf1.38.0核心
FBSDKCoreKit18.0.3登入管道
FBSDKCoreKit_Basics18.0.3登入管道
FBAEMKit18.0.3登入管道
FBSDKLoginKit18.0.3登入管道
GoogleSignIn8.0.0登入管道
AppAuth1.7.6登入管道
GTMAppAuth4.1.1登入管道
GTMSessionFetcher3.5.0登入管道
AppsFlyerLib6.17.9分析
FirebaseAnalytics11.15.0分析
ThinkingSDK3.4.0分析
ThinkingDataCore1.3.3分析
GoogleAdsOnDeviceConversion2.1.0分析
GoogleAppMeasurement11.15.0分析
FBSDKShareKit18.0.3社群
FBSDKGamingServicesKit18.0.3社群
IronSource8.3.0應用程式內廣告
IronSourceAdQualitySDK7.21.0應用程式內廣告
IASDKCore8.3.1應用程式內廣告
ISFacebookAdapter4.3.46應用程式內廣告
ISFyberAdapter4.3.36.2應用程式內廣告
ISAdMobAdapter4.3.57應用程式內廣告
ISUnityAdsAdapter4.3.43應用程式內廣告
UnityAds4.16.1應用程式內廣告
GoogleMobileAds11.10.0應用程式內廣告
FBAudienceNetwork6.21.1應用程式內廣告
GoogleUserMessagingPlatform2.7.0應用程式內廣告
CleverTapSDK7.7.0Engage
CTNotificationService0.1.7Engage
CTNotificationContent1.3.0Engage
FirebaseMessaging11.15.0Engage
FirebaseRemoteConfig11.15.0Engage
FirebaseInAppMessaging11.15.0Engage
FirebaseABTesting11.15.0Engage
FirebaseRemoteConfigInterop11.15.0Engage
SDWebImage5.21.0Engage
版本分组
Reachability3.7.7核心
KeychainAccess4.2.2核心
SwiftCentrifuge0.8.2核心
FirebaseCore11.15.0核心
FirebaseInstallations11.15.0核心
FirebaseCrashlytics11.15.0核心
FirebaseCoreInternal11.15.0核心
FirebaseSharedSwift11.15.0核心
GoogleUtilities8.1.0核心
GoogleDataTransport10.1.0核心
nanopb2.30910.0核心
FBLPromises2.4.0核心
AppCheckCore11.2.0核心
SwiftProtobuf1.38.0核心
FBSDKCoreKit18.0.3登录渠道
FBSDKCoreKit_Basics18.0.3登录渠道
FBAEMKit18.0.3登录渠道
FBSDKLoginKit18.0.3登录渠道
GoogleSignIn8.0.0登录渠道
AppAuth1.7.6登录渠道
GTMAppAuth4.1.1登录渠道
GTMSessionFetcher3.5.0登录渠道
AppsFlyerLib6.17.9分析
FirebaseAnalytics11.15.0分析
ThinkingSDK3.4.0分析
ThinkingDataCore1.3.3分析
GoogleAdsOnDeviceConversion2.1.0分析
GoogleAppMeasurement11.15.0分析
FBSDKShareKit18.0.3社交
FBSDKGamingServicesKit18.0.3社交
IronSource8.3.0应用内广告
IronSourceAdQualitySDK7.21.0应用内广告
IASDKCore8.3.1应用内广告
ISFacebookAdapter4.3.46应用内广告
ISFyberAdapter4.3.36.2应用内广告
ISAdMobAdapter4.3.57应用内广告
ISUnityAdsAdapter4.3.43应用内广告
UnityAds4.16.1应用内广告
GoogleMobileAds11.10.0应用内广告
FBAudienceNetwork6.21.1应用内广告
GoogleUserMessagingPlatform2.7.0应用内广告
CleverTapSDK7.7.0Engage
CTNotificationService0.1.7Engage
CTNotificationContent1.3.0Engage
FirebaseMessaging11.15.0Engage
FirebaseRemoteConfig11.15.0Engage
FirebaseInAppMessaging11.15.0Engage
FirebaseABTesting11.15.0Engage
FirebaseRemoteConfigInterop11.15.0Engage
SDWebImage5.21.0Engage

Installation

Install the SDK with Swift Package Manager or manually with the frameworks.

使用 Swift Package Manager手動加入 frameworks 來安裝 SDK。

使用 Swift Package Manager手动添加 frameworks 来安装 SDK。

Swift Package Manager

The SDK integrates with Swift Package Manager: the SDK ships as an Exported/ bundle: add the Swift Package, run VGSDK Configure, then build. The bundle contains:

此 SDK 透過 Swift Package Manager 整合:SDK 以 Exported/ bundle 形式提供: 加入 Swift Package、執行 VGSDK Configure,然後建置。此 bundle 包含:

该 SDK 通过 Swift Package Manager 集成:SDK 以 Exported/ bundle 形式提供: 添加 Swift Package、运行 VGSDK Configure,然后构建。该 bundle 包含:

Exported/
├── add-vgsdk-package.sh          ← run this to integrate the SDK (does the 3 steps for you)
├── VGSDKPackages/                ← the Swift Package you add to Xcode (library + VGSDK Configure plugin)
├── VGSDKResources/
│   ├── Resources/                ← your game's config (VGSDKService-Info.plist, GoogleService-Info.plist, …)
│   └── FirebaseCrashlytics/      ← Crashlytics dSYM-upload tooling (run script)
├── PassSDKDemo/                  ← reference demo app
├── PassSDKDemo.xcodeproj         ← its Xcode project
├── PassSDKDemoServiceExtension/  ← demo Notification Service extension
└── PassSDKDemoContentExtension/  ← demo Notification Content extension

Keep the folder layout intact. VGSDKResources/ must stay next to VGSDKPackages/: the configure plugin reads your config from there.

請保持資料夾結構完整。 VGSDKResources/ 必須與 VGSDKPackages/ 並排放置: configure 外掛程式會從該處讀取你的設定。

请保持文件夹结构完整。 VGSDKResources/ 必须与 VGSDKPackages/ 相邻放置: configure 插件会从那里读取你的配置。

Add the Swift Package

Do this one of two ways: the automated script (recommended) or by hand in Xcode:

有兩種方式可完成此步驟: 自動化指令碼(建議)或在 Xcode 中手動操作:

有两种方式可完成此步骤: 自动化脚本(推荐)或在 Xcode 中手动操作:

Run the bundled helper from the Exported/ folder and it performs the whole integration end-to-end:

Exported/ 資料夾中執行隨附的輔助指令碼,它會端到端完成整個整合流程:

Exported/ 文件夹中运行随附的辅助脚本,它会端到端完成整个集成流程:

./add-vgsdk-package.sh

That single command does everything: adds the package, resolves the dependency graph from the VNGGames Nexus (needs network), auto-wires any notification extensions, and runs VGSDK Configure. It’s idempotent and best-effort: on failure it prints the exact manual command and continues (the package is still added), backing up project.pbxproj first. Add --verbose for live output, then reopen the project in Xcode.

這一道指令會完成所有工作: 加入套件、從 VNGGames Nexus 解析相依關係圖(需要網路)、自動接上任何通知擴充功能,並執行 VGSDK Configure。它具幂等性且採盡力而為策略:失敗時會印出確切的手動指令並繼續執行(套件仍會被加入),並會先備份 project.pbxproj。加上 --verbose 可取得即時輸出,然後在 Xcode 中重新開啟專案。

这一条命令会完成所有工作: 添加包、从 VNGGames Nexus 解析依赖关系图(需要网络)、自动接入任何通知扩展,并运行 VGSDK Configure。它具有幂等性且采用尽力而为策略:失败时会打印确切的手动命令并继续执行(包仍会被添加),并会先备份 project.pbxproj。加上 --verbose 可获取实时输出,然后在 Xcode 中重新打开项目。

SwiftPM fetches the binary frameworks (PassSDK + 3rd-party) from the VNGGames Nexus at build time, so the first resolve needs network access.

SwiftPM 會在建置時從 VNGGames Nexus 取得二進位 frameworks(PassSDK 與第三方),因此首次解析需要網路連線。

SwiftPM 会在构建时从 VNGGames Nexus 获取二进制 frameworks(PassSDK 与第三方),因此首次解析需要网络连接。

Run “VGSDK Configure”

Adding the package does not auto-configure your app: SwiftPM has no install hook. Run the bundled VGSDK Configure command plugin once. It:

  • Copies your config plists from VGSDKResources/ into your app’s source folder (VGSDKService-Info.plist, VGSDKIronSource-Info.plist, GoogleService-Info.plist).
  • Writes your Info.plist: URL schemes (Facebook / Google / VGA), LSApplicationQueriesSchemes, App Transport Security, SKAdNetworkItems, GADApplicationIdentifier, NSUserTrackingUsageDescription, the social-sharing privacy prompts, and: for push: the remote-notification UIBackgroundModes entry. Your own usage-description strings are never overwritten.
  • Edits project.pbxproj: adds the config plists to Copy Bundle Resources, adds the Firebase Crashlytics dSYM-upload Run Script phase, and enables the SDK’s capabilities (aps-environment for Push, com.apple.developer.applesignin for Sign in with Apple), creating <app>/<Target>.entitlements if absent. It is idempotent: safe to re-run after editing your config.

加入套件並不會自動設定你的 App: SwiftPM 沒有安裝掛鉤。請執行隨附的 VGSDK Configure command plugin 一次。它會:

  • 複製你的設定 plist: 從 VGSDKResources/ 複製到你 App 的原始碼資料夾(VGSDKService-Info.plistVGSDKIronSource-Info.plistGoogleService-Info.plist)。
  • 寫入你的 Info.plist: URL schemes(Facebook / Google / VGA)、LSApplicationQueriesSchemes、App Transport Security、SKAdNetworkItemsGADApplicationIdentifierNSUserTrackingUsageDescription、社群分享隱私提示,以及: 針對推播: remote-notificationUIBackgroundModes 項目。你自己的 usage-description 字串永遠不會被覆寫。
  • 編輯 project.pbxproj: 將設定 plist 加入 Copy Bundle Resources、加入 Firebase Crashlytics dSYM-upload Run Script 階段,並啟用 SDK 的功能(Push 使用 aps-environment、Sign in with Apple 使用 com.apple.developer.applesignin),若 <app>/<Target>.entitlements 不存在則建立它。 它具有幂等性: 在編輯設定後可安全地重新執行。

添加包不会自动配置你的 App: SwiftPM 没有安装钩子。请运行随附的 VGSDK Configure command plugin 一次。它会:

  • 复制你的配置 plist: 从 VGSDKResources/ 复制到你 App 的源码文件夹(VGSDKService-Info.plistVGSDKIronSource-Info.plistGoogleService-Info.plist)。
  • 写入你的 Info.plist: URL schemes(Facebook / Google / VGA)、LSApplicationQueriesSchemes、App Transport Security、SKAdNetworkItemsGADApplicationIdentifierNSUserTrackingUsageDescription、社交分享隐私提示,以及: 针对推送: remote-notificationUIBackgroundModes 项。你自己的 usage-description 字符串永远不会被覆盖。
  • 编辑 project.pbxproj: 将配置 plist 添加到 Copy Bundle Resources、添加 Firebase Crashlytics dSYM-upload Run Script 阶段,并启用 SDK 的能力(Push 使用 aps-environment、Sign in with Apple 使用 com.apple.developer.applesignin),若 <app>/<Target>.entitlements 不存在则创建它。 它具有幂等性: 在编辑配置后可安全地重新运行。
  • Sets up the CleverTap notification extension: when your game uses CleverTap, creates the App Group + Notification Service / Content extension so push impressions are recorded (no manual extension setup).
  • 設定 CleverTap 通知擴充功能: 當你的遊戲使用 CleverTap 時,建立 App Group 與 Notification Service/Content 擴充功能,讓推播曝光(push impressions)得以記錄(無需手動設定擴充功能)。
  • 设置 CleverTap 通知扩展: 当你的游戏使用 CleverTap 时,创建 App Group 与 Notification Service/Content 扩展,让推送曝光(push impressions)得以记录(无需手动设置扩展)。

Provisioning is still yours. The plugin declares the capabilities, but you must enable Push Notifications and Sign in with Apple for your App ID in the Apple Developer portal and use a matching provisioning profile. Xcode resolves the live APNs environment from the signing profile at build time.

佈建仍由你負責。 此外掛程式會宣告這些功能,但你必須在 Apple Developer portal 中為你的 App ID 啟用 Push NotificationsSign in with Apple,並使用相符的佈建描述檔(provisioning profile)。Xcode 會在建置時從簽署描述檔解析出實際的 APNs 環境。

预置描述文件仍由你负责。 该插件会声明这些能力,但你必须在 Apple Developer portal 中为你的 App ID 启用 Push NotificationsSign in with Apple,并使用相匹配的预置描述文件(provisioning profile)。Xcode 会在构建时从签名描述文件解析出实际的 APNs 环境。

Run the VGSDK Configure plugin from the command line. The destination (your app folder + .xcodeproj) is outside the package, so grant your project directory in addition to the package directory:

從命令列執行 VGSDK Configure 外掛程式。目的地(你的 App 資料夾 + .xcodeproj)位於套件之外,因此除了套件目錄外,還需授予你的專案目錄權限:

从命令行运行 VGSDK Configure 插件。目标位置(你的 App 文件夹 + .xcodeproj)位于包之外,因此除了包目录之外,还需授予你的项目目录权限:

cd {path}/VGSDKPackages
swift package \
  --allow-writing-to-package-directory \
  --allow-writing-to-directory "/full/path/to/your/project/dir" \
  vgsdk-configure

If a write is denied, the plugin prints the exact command (with the resolved path) to re-run.

若某次寫入被拒絕,外掛程式會印出(含已解析路徑的)確切指令供你重新執行。

若某次写入被拒绝,插件会打印(含已解析路径的)确切命令供你重新运行。

Finish & verify

Reopen the project in Xcode (or let it reload) so it picks up the edited project.pbxproj (a backup is saved at project.pbxproj.vgsdk-bak), then build and run. Confirm:

  • App target → Build Phases → Copy Bundle Resources contains the three config plists.
  • App target → Build Phases has a [VGSDK] Run Firebase Crashlytics Run Script phase.
  • Info.plist has the VNGGames URL schemes / queried schemes / SKAdNetwork entries.

在 Xcode 中重新開啟專案(或讓它重新載入),使其套用已編輯的 project.pbxproj(備份會儲存在 project.pbxproj.vgsdk-bak),然後建置並執行。請確認:

  • App target → Build Phases → Copy Bundle Resources 包含這三個設定 plist。
  • App target → Build Phases 有一個 [VGSDK] Run Firebase Crashlytics Run Script 階段。
  • Info.plist 已包含 VNGGames 的 URL schemes / queried schemes / SKAdNetwork 項目。

在 Xcode 中重新打开项目(或让它重新加载),使其应用已编辑的 project.pbxproj(备份会保存在 project.pbxproj.vgsdk-bak),然后构建并运行。请确认:

  • App target → Build Phases → Copy Bundle Resources 包含这三个配置 plist。
  • App target → Build Phases 有一个 [VGSDK] Run Firebase Crashlytics Run Script 阶段。
  • Info.plist 已包含 VNGGames 的 URL schemes / queried schemes / SKAdNetwork 项。
Troubleshooting
Xcode says “Plugin wants permission to write to the package directory.”

SwiftPM sandboxes plugin writes. Add --allow-writing-to-package-directory on the CLI, or approve the prompt in Xcode.

“Cannot write to …: outside the package.”

Your app folder / .xcodeproj lives outside the package directory, which the sandbox blocks by default. Add --allow-writing-to-directory "<dir>" for the printed path: use the common parent of your app folder and the .xcodeproj.

The plugin reports “No .xcodeproj found.”

It couldn’t auto-detect your project from the working directory. Run it from your app project in Xcode, or pass --dest <dir> and --info-plist <path> explicitly.

Package resolve fails with “checksum … does not match.”

A binary framework was re-published with new contents, so the cached checksum is stale. In Xcode: File → Packages → Reset Package Caches, then resolve again. If it persists, clear the global cache (below).

The package cache is stale or corrupt after a re-publish.

SwiftPM’s global cache is holding the old artifact. Quit Xcode, then run rm -rf ~/Library/Caches/org.swift.swiftpm and reopen / resolve again.

Reset + global clear still serves the old binary.

Xcode keeps its own resolved clones inside DerivedData, separate from the global cache. Quit Xcode, then run rm -rf ~/Library/Developer/Xcode/DerivedData and reopen / resolve. To target one app instead, delete only its …/DerivedData/<Project>-<hash>/SourcePackages/.

My config changes aren’t taking effect.

The build is using the previously-copied plists. Re-run VGSDK Configure (it’s idempotent), then do a clean build.

The first build fails to fetch frameworks.

The binary frameworks resolve from the VNGGames Nexus, which needs network access on the first resolve. Ensure you’re on a network that can reach the VNGGames Nexus, then File → Packages → Resolve Package Versions.

Push notifications / Sign in with Apple don’t work at runtime.

The plugin declares the capabilities, but the App ID and provisioning profile must enable them on Apple’s side. Enable Push Notifications and Sign in with Apple for your App ID in the Apple Developer portal, and use a matching provisioning profile.

Do I need to add an “In-App Purchase” capability?

No: In-App Purchase has no real, enforced entitlement, so StoreKit (which VGSDKPayment wraps) works without it and VGSDK Configure never adds one (neither should you). If purchases fail, check that: products with the same item IDs you pass to VGSDKPayment exist in App Store Connect, the Paid Apps agreement is active, you’re testing with a Sandbox Apple Account, and the user is logged in (login is required before any purchase).

Xcode 顯示 “Plugin wants permission to write to the package directory.”

SwiftPM 會沙箱化外掛程式的寫入。請在 CLI 上加上 --allow-writing-to-package-directory,或在 Xcode 中核准該提示。

“Cannot write to …: outside the package.”

你的 App 資料夾 / .xcodeproj 位於套件目錄之外,而沙箱預設會封鎖此情況。請為印出的路徑加上 --allow-writing-to-directory "<dir>": 使用你的 App 資料夾與 .xcodeproj 的共同上層目錄。

外掛程式回報 “No .xcodeproj found.”

它無法從工作目錄自動偵測到你的專案。請在 Xcode 中從你的 App 專案執行它,或明確傳入 --dest <dir>--info-plist <path>

套件解析失敗並顯示 “checksum … does not match.”

某個二進位 framework 以新內容重新發佈,因此快取的 checksum 已過時。在 Xcode 中:File → Packages → Reset Package Caches,然後重新解析。若問題持續,請清除全域快取(見下方)。

重新發佈後套件快取過時或損毀。

SwiftPM 的全域快取仍保有舊的成品。請結束 Xcode,然後執行 rm -rf ~/Library/Caches/org.swift.swiftpm,再重新開啟 / 重新解析。

重設 + 清除全域快取後仍提供舊的二進位檔。

Xcode 會在 DerivedData 內保留自己的已解析副本,與全域快取分開。請結束 Xcode,然後執行 rm -rf ~/Library/Developer/Xcode/DerivedData,再重新開啟 / 重新解析。若只想針對單一 App,僅刪除其 …/DerivedData/<Project>-<hash>/SourcePackages/

我的設定變更未生效。

建置仍在使用先前複製的 plist。請重新執行 VGSDK Configure(它具有幂等性),然後執行一次乾淨建置。

首次建置無法取得 frameworks。

二進位 frameworks 從 VNGGames Nexus 解析,首次解析時需要網路連線。請確認你所在的網路可連到 VNGGames Nexus,然後執行 File → Packages → Resolve Package Versions

推播通知 / Sign in with Apple 在執行階段無法運作。

此外掛程式會宣告這些功能,但 App ID 與佈建描述檔必須在 Apple 端啟用它們。請在 Apple Developer portal 中為你的 App ID 啟用 Push NotificationsSign in with Apple,並使用相符的佈建描述檔。

我需要新增 “In-App Purchase” 功能嗎?

不需要: In-App Purchase 沒有真正強制的 entitlement,因此 StoreKit(由 VGSDKPayment 包裝)無需它即可運作,VGSDK Configure 也不會加入(你也不應加入)。若購買失敗,請檢查:與你傳給 VGSDKPayment 的相同 item ID 的產品確實存在於 App Store ConnectPaid Apps agreement 已生效、你正使用 Sandbox Apple Account 進行測試,且使用者已登入(任何購買前都必須先登入)。

Xcode 显示 “Plugin wants permission to write to the package directory.”

SwiftPM 会对插件写入进行沙箱化。请在 CLI 上加上 --allow-writing-to-package-directory,或在 Xcode 中批准该提示。

“Cannot write to …: outside the package.”

你的 App 文件夹 / .xcodeproj 位于包目录之外,而沙箱默认会阻止此情况。请为打印出的路径加上 --allow-writing-to-directory "<dir>": 使用你的 App 文件夹与 .xcodeproj 的公共父目录。

插件报告 “No .xcodeproj found.”

它无法从工作目录自动检测到你的项目。请在 Xcode 中从你的 App 项目运行它,或显式传入 --dest <dir>--info-plist <path>

包解析失败并显示 “checksum … does not match.”

某个二进制 framework 以新内容重新发布,因此缓存的 checksum 已过时。在 Xcode 中:File → Packages → Reset Package Caches,然后重新解析。若问题持续,请清除全局缓存(见下方)。

重新发布后包缓存过时或损坏。

SwiftPM 的全局缓存仍保留着旧的产物。请退出 Xcode,然后运行 rm -rf ~/Library/Caches/org.swift.swiftpm,再重新打开 / 重新解析。

重置 + 清除全局缓存后仍提供旧的二进制文件。

Xcode 会在 DerivedData 内保留自己的已解析克隆,与全局缓存分开。请退出 Xcode,然后运行 rm -rf ~/Library/Developer/Xcode/DerivedData,再重新打开 / 重新解析。若只想针对单个 App,仅删除其 …/DerivedData/<Project>-<hash>/SourcePackages/

我的配置更改未生效。

构建仍在使用先前复制的 plist。请重新运行 VGSDK Configure(它具有幂等性),然后执行一次干净构建。

首次构建无法获取 frameworks。

二进制 frameworks 从 VNGGames Nexus 解析,首次解析时需要网络连接。请确认你所在的网络可连到 VNGGames Nexus,然后执行 File → Packages → Resolve Package Versions

推送通知 / Sign in with Apple 在运行时无法工作。

该插件会声明这些能力,但 App ID 与预置描述文件必须在 Apple 端启用它们。请在 Apple Developer portal 中为你的 App ID 启用 Push NotificationsSign in with Apple,并使用相匹配的预置描述文件。

我需要添加 “In-App Purchase” 能力吗?

不需要: In-App Purchase 没有真正强制的 entitlement,因此 StoreKit(由 VGSDKPayment 包装)无需它即可工作,VGSDK Configure 也不会添加(你也不应添加)。若购买失败,请检查:与你传给 VGSDKPayment 的相同 item ID 的商品确实存在于 App Store ConnectPaid Apps agreement 已生效、你正使用 Sandbox Apple Account 进行测试,且用户已登录(任何购买前都必须先登录)。

Manual (frameworks)

Use this path only when Swift Package Manager isn’t an option, for example a build that vendors the frameworks or must resolve them offline.

只有在無法使用 Swift Package Manager 時才採用此路徑,例如需要隨附(vendor)frameworks 或必須離線解析相依項的建置。

仅在无法使用 Swift Package Manager 时才采用此路径,例如需要随附(vendor)frameworks 或必须离线解析依赖项的构建。

Exported/
├── VGSDKResources/
│   ├── Frameworks/               ← the dependency .xcframeworks (add each · Embed & Sign)
│   ├── Resources/                ← your game's config (VGSDKService-Info.plist, GoogleService-Info.plist, …)
│   └── FirebaseCrashlytics/      ← Crashlytics dSYM-upload tooling (run script)
├── PassSDKDemo/                  ← reference demo app
├── PassSDKDemo.xcodeproj         ← its Xcode project
├── PassSDKDemoServiceExtension/  ← demo Notification Service extension
└── PassSDKDemoContentExtension/  ← demo Notification Content extension
Add the frameworks

The dependency .xcframeworks are already provided in the bundle’s VGSDKResources/Frameworks folder.

相依的 .xcframework 已包含在 bundle 的 VGSDKResources/Frameworks 資料夾中。

依赖的 .xcframework 已包含在 bundle 的 VGSDKResources/Frameworks 文件夹中。

In Xcode, select your app target → General → Frameworks, Libraries & Embedded Content. Add every .xcframework from VGSDKResources/Frameworks and set each one to Embed & Sign (the SDK framework is dynamic, so it must be embedded and signed).

在 Xcode 中選取你的 App target → General → Frameworks, Libraries & Embedded Content。將 VGSDKResources/Frameworks 中的每一個 .xcframework 加入,並將每一個都設為 Embed & Sign(SDK framework 為動態,因此必須嵌入並簽署)。

在 Xcode 中选择你的 App target → General → Frameworks, Libraries & Embedded Content。将 VGSDKResources/Frameworks 中的每一个 .xcframework 添加进来,并将每一个都设为 Embed & Sign(SDK framework 为动态,因此必须嵌入并签名)。

One exception: the two CleverTap notification-extension frameworks (CTNotificationService, CTNotificationContent) go to the extension targets, not the app target. The CleverTap notification extensions step adds those.

僅有一個例外:兩個 CleverTap 通知擴充功能 frameworks(CTNotificationServiceCTNotificationContent)屬於擴充功能 target,而非 App target。CleverTap 通知擴充功能步驟會加入這兩個。

仅有一个例外:两个 CleverTap 通知扩展 frameworks(CTNotificationServiceCTNotificationContent)属于扩展 target,而非 App target。CleverTap 通知扩展步骤会添加这两个。

VGSDKResources/Frameworks/
├── …                                   ← every .xcframework here → app target (Embed & Sign)
├── CTNotificationService.xcframework   ← notification-extension target only, not the app
└── CTNotificationContent.xcframework   ← notification-extension target only, not the app
Build settings

On your app target → Build Settings, set:

  • Minimum Deployments (iOS) = 13.0.
  • Other Linker Flags = -ObjC -weak_framework AdServices.
  • Add libsqlite3.tbd under Frameworks, Libraries & Embedded Content.
  • DEBUG_INFORMATION_FORMAT = dwarf-with-dsym (every configuration): lets Firebase Crashlytics generate dSYMs to upload (Run-Script phase in the Firebase Crashlytics step).
  • ENABLE_USER_SCRIPT_SANDBOXING = NO: lets that Crashlytics Run-Script access the dSYM.

在你的 App target → Build Settings 設定:

  • Minimum Deployments (iOS) = 13.0
  • Other Linker Flags = -ObjC -weak_framework AdServices
  • Frameworks, Libraries & Embedded Content 中加入 libsqlite3.tbd
  • DEBUG_INFORMATION_FORMAT = dwarf-with-dsym(每個 configuration):讓 Firebase Crashlytics 產生可上傳的 dSYM(Run-Script 階段見 Firebase Crashlytics 步驟)。
  • ENABLE_USER_SCRIPT_SANDBOXING = NO:讓該 Crashlytics Run-Script 能存取 dSYM。

在你的 App target → Build Settings 设置:

  • Minimum Deployments (iOS) = 13.0
  • Other Linker Flags = -ObjC -weak_framework AdServices
  • Frameworks, Libraries & Embedded Content 中添加 libsqlite3.tbd
  • DEBUG_INFORMATION_FORMAT = dwarf-with-dsym(每个 configuration):让 Firebase Crashlytics 生成可上传的 dSYM(Run-Script 阶段见 Firebase Crashlytics 步骤)。
  • ENABLE_USER_SCRIPT_SANDBOXING = NO:让该 Crashlytics Run-Script 能访问 dSYM。
Add your config plists

Copy the three configuration plists from the bundle’s VGSDKResources/Resources into your app’s source folder, then add them to the app target’s Build Phases → Copy Bundle Resources:

  • VGSDKService-Info.plist
  • VGSDKIronSource-Info.plist
  • GoogleService-Info.plist

The SDK reads them from Bundle.main at runtime, so they must be members of the app target. Copy Bundle Resources flattens them to the bundle root.

將三個設定 plist 從 bundle 的 VGSDKResources/Resources 複製到你 App 的原始碼資料夾,然後將它們加入 App target 的 Build Phases → Copy Bundle Resources

  • VGSDKService-Info.plist
  • VGSDKIronSource-Info.plist
  • GoogleService-Info.plist

SDK 會在執行階段從 Bundle.main 讀取它們,因此它們必須是 App target 的成員。Copy Bundle Resources 會將它們平整化到 bundle 根目錄。

将三个配置 plist 从 bundle 的 VGSDKResources/Resources 复制到你 App 的源码文件夹,然后将它们添加到 App target 的 Build Phases → Copy Bundle Resources

  • VGSDKService-Info.plist
  • VGSDKIronSource-Info.plist
  • GoogleService-Info.plist

SDK 会在运行时从 Bundle.main 读取它们,因此它们必须是 App target 的成员。Copy Bundle Resources 会将它们平整化到 bundle 根目录。

Configure Info.plist

Add these keys to your app’s Info.plist. The feature groups below are only needed if your game uses that feature. Each value marked derived names the exact key to copy from your VGSDKService-Info.plist (e.g. Features.VGA.ClientID): use your game’s real values and never copy a placeholder id.

將以下鍵加入你 App 的 Info.plist。下方的功能分組僅在你的遊戲使用該功能時才需要。每個標示為 derived(衍生)的值都會指明要從你的 VGSDKService-Info.plist 複製的確切鍵(例如 Features.VGA.ClientID):請使用你遊戲的真實值,切勿複製任何佔位 id。

将以下键添加到你 App 的 Info.plist。下方的功能分组仅在你的游戏使用该功能时才需要。每个标记为 derived(衍生)的值都会指明要从你的 VGSDKService-Info.plist 复制的确切键(例如 Features.VGA.ClientID):请使用你游戏的真实值,切勿复制任何占位 id。

Core (always)
KeyValue
NSAppTransportSecurity{ NSAllowsArbitraryLoads: true }
NSUserTrackingUsageDescriptionRecommended: We use tracking to personalize your experience and show you relevant content.
GADApplicationIdentifierderived from the top-level AdMobID in VGSDKService-Info.plist (only when available).
核心(一律需要)
NSAppTransportSecurity{ NSAllowsArbitraryLoads: true }
NSUserTrackingUsageDescription建議值:We use tracking to personalize your experience and show you relevant content.
GADApplicationIdentifierderived,來自 VGSDKService-Info.plist 中最上層的 AdMobID(僅在可用時)。
核心(始终需要)
NSAppTransportSecurity{ NSAllowsArbitraryLoads: true }
NSUserTrackingUsageDescription建议值:We use tracking to personalize your experience and show you relevant content.
GADApplicationIdentifierderived,来自 VGSDKService-Info.plist 中最顶层的 AdMobID(仅在可用时)。
Sign-in (VNGGames Account, Google, Facebook)

Needed for VGA, Google, and Facebook login.

KeyValue
GGVNGClientIDderived from Features.VGA.ClientID: A VNGGames Account credential the SDK reads.
GGVNGClientTokenderived from Features.VGA.ClientToken: A VNGGames Account credential the SDK reads.
GIDClientIDderived from Features.Google.ClientID: The Google Sign-In client id.
FacebookAppIDderived from Features.Facebook.AppID.
FacebookClientTokenderived from Features.Facebook.ClientToken.
CFBundleURLTypes (URL scheme)• VGA: gg-<GGVNGClientID> (derived)
• Google: copy REVERSED_CLIENT_ID from your GoogleService-Info.plist
• Facebook: fb<FacebookAppID> (derived)
• Append only schemes not already present.
LSApplicationQueriesSchemesggvng-api
fbapi
fbauth2
fb-messenger-api
fb-messenger-share-api
fbshareextension
登入(VNGGames Account、Google、Facebook)

VGA、Google 與 Facebook 登入所需。

GGVNGClientIDderived,來自 Features.VGA.ClientID:SDK 會讀取的 VNGGames Account 憑證。
GGVNGClientTokenderived,來自 Features.VGA.ClientToken:SDK 會讀取的 VNGGames Account 憑證。
GIDClientIDderived,來自 Features.Google.ClientID:Google Sign-In 用戶端 id。
FacebookAppIDderived,來自 Features.Facebook.AppID
FacebookClientTokenderived,來自 Features.Facebook.ClientToken
CFBundleURLTypes(URL scheme)• VGA:gg-<GGVNGClientID>derived
• Google:從你的 GoogleService-Info.plist 複製 REVERSED_CLIENT_ID
• Facebook:fb<FacebookAppID>derived
• 僅附加尚未存在的 scheme。
LSApplicationQueriesSchemesggvng-api
fbapi
fbauth2
fb-messenger-api
fb-messenger-share-api
fbshareextension
登录(VNGGames Account、Google、Facebook)

VGA、Google 与 Facebook 登录所需。

GGVNGClientIDderived,来自 Features.VGA.ClientID:SDK 会读取的 VNGGames Account 凭据。
GGVNGClientTokenderived,来自 Features.VGA.ClientToken:SDK 会读取的 VNGGames Account 凭据。
GIDClientIDderived,来自 Features.Google.ClientID:Google Sign-In 客户端 id。
FacebookAppIDderived,来自 Features.Facebook.AppID
FacebookClientTokenderived,来自 Features.Facebook.ClientToken
CFBundleURLTypes(URL scheme)• VGA:gg-<GGVNGClientID>derived
• Google:从你的 GoogleService-Info.plist 复制 REVERSED_CLIENT_ID
• Facebook:fb<FacebookAppID>derived
• 仅追加尚未存在的 scheme。
LSApplicationQueriesSchemesggvng-api
fbapi
fbauth2
fb-messenger-api
fb-messenger-share-api
fbshareextension
Social sharing (photo, camera, Instagram)

Shared by Facebook and Instagram sharing. Your own values are kept if already set.

KeyValue
NSPhotoLibraryUsageDescriptionPhoto library access prompt. Recommended: We need access to your photo library so you can choose photos to post on social media.
NSPhotoLibraryAddUsageDescriptionPhoto library add access prompt. Recommended: We need permission to save photos, screenshots, and media to your device.
NSCameraUsageDescriptionCamera access prompt. Recommended: We need access to your camera so you can take and share photos on social media.
LSApplicationQueriesSchemes (Instagram)instagram-stories
instagram
社群分享(相片、相機、Instagram)

由 Facebook 與 Instagram 分享共用。若你已設定自己的值則保留。

NSPhotoLibraryUsageDescription相片圖庫存取提示。建議值:We need access to your photo library so you can choose photos to post on social media.
NSPhotoLibraryAddUsageDescription相片圖庫新增存取提示。建議值:We need permission to save photos, screenshots, and media to your device.
NSCameraUsageDescription相機存取提示。建議值:We need access to your camera so you can take and share photos on social media.
LSApplicationQueriesSchemes(Instagram)instagram-stories
instagram
社交分享(相片、相机、Instagram)

由 Facebook 与 Instagram 分享共用。若你已设置自己的值则保留。

NSPhotoLibraryUsageDescription相册访问提示。建议值:We need access to your photo library so you can choose photos to post on social media.
NSPhotoLibraryAddUsageDescription相册添加访问提示。建议值:We need permission to save photos, screenshots, and media to your device.
NSCameraUsageDescription相机访问提示。建议值:We need access to your camera so you can take and share photos on social media.
LSApplicationQueriesSchemes(Instagram)instagram-stories
instagram
CleverTap (Engage)
KeyValue
CleverTapAccountIDderived from Features.CleverTap.AccountID.
CleverTapTokenderived from Features.CleverTap.Token.
CleverTapRegionderived from Features.CleverTap.Region.
CleverTapDisableIDFVtrue
CleverTap(Engage)
CleverTapAccountIDderived,來自 Features.CleverTap.AccountID
CleverTapTokenderived,來自 Features.CleverTap.Token
CleverTapRegionderived,來自 Features.CleverTap.Region
CleverTapDisableIDFVtrue
CleverTap(Engage)
CleverTapAccountIDderived,来自 Features.CleverTap.AccountID
CleverTapTokenderived,来自 Features.CleverTap.Token
CleverTapRegionderived,来自 Features.CleverTap.Region
CleverTapDisableIDFVtrue
In-app ads: ironSource
KeyValue
SKAdNetworkItemsMerge one { SKAdNetworkIdentifier: … } entry per identifier (unioned across ad networks by id):
su67r6k2v3.skadnetwork
cstr6suwn9.skadnetwork
9g2aggbj52.skadnetwork
v9wttpbfk9.skadnetwork
n38lu8286q.skadnetwork
4dzt52r2t5.skadnetwork
NSAdvertisingAttributionReportEndpointhttps://postbacks-is.com
應用內廣告:ironSource
SKAdNetworkItems每個識別碼合併一個 { SKAdNetworkIdentifier: … } 項目(跨各廣告網路依 id 取聯集):
su67r6k2v3.skadnetwork
cstr6suwn9.skadnetwork
9g2aggbj52.skadnetwork
v9wttpbfk9.skadnetwork
n38lu8286q.skadnetwork
4dzt52r2t5.skadnetwork
NSAdvertisingAttributionReportEndpointhttps://postbacks-is.com
应用内广告:ironSource
SKAdNetworkItems每个标识符合并一个 { SKAdNetworkIdentifier: … } 项(跨各广告网络按 id 取并集):
su67r6k2v3.skadnetwork
cstr6suwn9.skadnetwork
9g2aggbj52.skadnetwork
v9wttpbfk9.skadnetwork
n38lu8286q.skadnetwork
4dzt52r2t5.skadnetwork
NSAdvertisingAttributionReportEndpointhttps://postbacks-is.com
In-app ads: Meta Audience Network
KeyValue
SKAdNetworkItemsMerge one { SKAdNetworkIdentifier: … } entry per identifier (unioned across ad networks by id):
v9wttpbfk9.skadnetwork
n38lu8286q.skadnetwork
應用內廣告:Meta Audience Network
SKAdNetworkItems每個識別碼合併一個 { SKAdNetworkIdentifier: … } 項目(跨各廣告網路依 id 取聯集):
v9wttpbfk9.skadnetwork
n38lu8286q.skadnetwork
应用内广告:Meta Audience Network
SKAdNetworkItems每个标识符合并一个 { SKAdNetworkIdentifier: … } 项(跨各广告网络按 id 取并集):
v9wttpbfk9.skadnetwork
n38lu8286q.skadnetwork
Capabilities & entitlements

In Xcode, select your app target → Signing & Capabilities+ Capability, and add the ones your build needs. Xcode creates and manages the .entitlements file and its code-signing setting for you.

在 Xcode 中選取你的 App target → Signing & Capabilities+ Capability,加入你的建置所需的功能。Xcode 會為你建立並管理 .entitlements 檔案及其程式碼簽署設定。

在 Xcode 中选择你的 App target → Signing & Capabilities+ Capability,添加你的构建所需的能力。Xcode 会为你创建并管理 .entitlements 文件及其代码签名设置。

  • Add Sign in with Apple.
  • 加入 Sign in with Apple
  • 添加 Sign in with Apple
  • Add Push Notifications and Background Modes (check Remote notifications).
  • 加入 Push NotificationsBackground Modes(勾選 Remote notifications)。
  • 添加 Push NotificationsBackground Modes(勾选 Remote notifications)。
  • Add App Groups and create group.<your app bundle id>, shared with the notification extensions step.
  • 加入 App Groups 並建立 group.<你的 App bundle id>,與通知擴充功能步驟共用。
  • 添加 App Groups 并创建 group.<你的 App bundle id>,与通知扩展步骤共用。

Provisioning is still yours. Enable the capabilities you added for your App ID in the Apple Developer portal and use a matching provisioning profile. The entitlements alone don’t grant them.

佈建仍由你負責。 請在 Apple Developer portal 中為此 App ID 啟用你所加入的功能,並使用相符的佈建描述檔(provisioning profile)。僅有 entitlements 並不會授予這些功能。

预置描述文件仍由你负责。 请在 Apple Developer portal 中为此 App ID 启用你所添加的能力,并使用相匹配的预置描述文件(provisioning profile)。仅有 entitlements 并不会授予这些能力。

Firebase Crashlytics

Crashlytics is baked into the SDK binary, but its dSYM upload needs a Run-Script phase. On the app target → Build Phases:

  • Copy the tooling: copy the bundle’s VGSDKResources/FirebaseCrashlytics/ folder into your project root (next to the .xcodeproj), matching the $SRCROOT path in the Run Script below.
  • Add a Run Script phase: click the + at the top-left of the phases list and choose New Run Script Phase, then drag it so it runs last. It must come after linking, because it consumes the dSYM and the linked executable.

Point the Run Script at the copied run script:

Crashlytics 已合併進 SDK 二進位檔,但其 dSYM 上傳需要一個 Run-Script 階段。在 App target → Build Phases

  • 複製工具: 將 bundle 的 VGSDKResources/FirebaseCrashlytics/ 資料夾複製到你的專案根目錄(與 .xcodeproj 同層),對應下方 Run Script 中的 $SRCROOT 路徑。
  • 加入 Run Script 階段: 點按階段列表左上角的 +,選擇 New Run Script Phase,再將它拖曳至最後執行。它必須排在連結之後,因為它會使用 dSYM 與已連結的執行檔。

將 Run Script 指向複製過來的 run 指令碼:

Crashlytics 已合并进 SDK 二进制文件,但其 dSYM 上传需要一个 Run-Script 阶段。在 App target → Build Phases

  • 复制工具: 将 bundle 的 VGSDKResources/FirebaseCrashlytics/ 文件夹复制到你的项目根目录(与 .xcodeproj 同层),对应下方 Run Script 中的 $SRCROOT 路径。
  • 添加 Run Script 阶段: 点击阶段列表左上角的 +,选择 New Run Script Phase,再将它拖到最后执行。它必须排在链接之后,因为它会使用 dSYM 与已链接的可执行文件。

将 Run Script 指向复制过来的 run 脚本:

"${SRCROOT}/VGSDKResources/FirebaseCrashlytics/run"

Then add these five Input Files to the Run Script phase:

接著將以下五個 Input Files 加入該 Run Script 階段:

接着将以下五个 Input Files 添加到该 Run Script 阶段:

${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist
$(BUILT_PRODUCTS_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist
$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)
CleverTap notification extensions (NSE + NCE)

If your game uses CleverTap, add two app extensions so rich pushes render and push impressions are recorded: a Notification Service extension (NSE) and a Notification Content extension (NCE). Create both as Foundation app extensions and embed each .appex in the app via the Embed Foundation Extensions copy-files phase (the app depends on both).

若你的遊戲使用 CleverTap,請加入兩個 App 擴充功能,讓豐富推播得以呈現並記錄推播曝光:一個 Notification Service 擴充功能(NSE) 與一個 Notification Content 擴充功能(NCE)。兩者都建立為 Foundation App 擴充功能,並透過 Embed Foundation Extensions 複製檔案階段將每個 .appex 嵌入 App(App 會相依於兩者)。

若你的游戏使用 CleverTap,请添加两个 App 扩展,让富推送得以呈现并记录推送曝光:一个 Notification Service 扩展(NSE) 与一个 Notification Content 扩展(NCE)。两者都创建为 Foundation App 扩展,并通过 Embed Foundation Extensions 复制文件阶段将每个 .appex 嵌入 App(App 会依赖于两者)。

Notification Service extension (NSE)

Add the target in Xcode: File → New → Target… → Notification Service Extension, with bundle id <app bundle id>.NotificationService. Xcode embeds the .appex in the app. Its Info.plist needs:

KeyValue
NSExtension.NSExtensionPointIdentifiercom.apple.usernotifications.service
NSExtension.NSExtensionPrincipalClass$(PRODUCT_MODULE_NAME).NotificationService (Swift)
NotificationService (Objective-C)
CleverTapAccountIDderived from Features.CleverTap.AccountID.
CleverTapTokenderived from Features.CleverTap.Token.
CleverTapRegionderived from Features.CleverTap.Region.
CleverTapDisableIDFVtrue
VGSDKAppGroupgroup.<app bundle id>
NSAppTransportSecurity{ NSAllowsArbitraryLoads: true } (the NSE downloads ct_mediaUrl, which may be http)

Set up the NSE target (the code below won’t compile until you do):

  • App Groups: on the NSE target → Signing & Capabilities+ Capability, add App Groups and select the same group.<app bundle id> as the app. Xcode writes the entitlement for you.
  • Frameworks: add CTNotificationService.xcframework and CleverTapSDK.xcframework (from VGSDKResources/Frameworks) to this target and set both to Embed & Sign.

Its principal class subclasses CTNotificationServiceExtension:

Notification Service 擴充功能(NSE)

在 Xcode 中新增 target:File → New → Target… → Notification Service Extension,bundle id 設為 <App bundle id>.NotificationService。Xcode 會將 .appex 嵌入 App。它的 Info.plist 需要:

NSExtension.NSExtensionPointIdentifiercom.apple.usernotifications.service
NSExtension.NSExtensionPrincipalClass$(PRODUCT_MODULE_NAME).NotificationService(Swift)
NotificationService(Objective-C)
CleverTapAccountIDderived,來自 Features.CleverTap.AccountID
CleverTapTokenderived,來自 Features.CleverTap.Token
CleverTapRegionderived,來自 Features.CleverTap.Region
CleverTapDisableIDFVtrue
VGSDKAppGroupgroup.<App bundle id>
NSAppTransportSecurity{ NSAllowsArbitraryLoads: true }(NSE 會下載 ct_mediaUrl,可能是 http)

設定 NSE target(完成前下方程式碼無法編譯):

  • App Groups: 在 NSE target → Signing & Capabilities+ Capability,加入 App Groups 並選擇與 App 相同的 group.<App bundle id>。Xcode 會為你寫入 entitlement。
  • Frameworks:CTNotificationService.xcframeworkCleverTapSDK.xcframework(來自 VGSDKResources/Frameworks)加入此 target 並將兩者設為 Embed & Sign

它的 principal class 繼承自 CTNotificationServiceExtension

Notification Service 扩展(NSE)

在 Xcode 中新增 target:File → New → Target… → Notification Service Extension,bundle id 设为 <App bundle id>.NotificationService。Xcode 会将 .appex 嵌入 App。它的 Info.plist 需要:

NSExtension.NSExtensionPointIdentifiercom.apple.usernotifications.service
NSExtension.NSExtensionPrincipalClass$(PRODUCT_MODULE_NAME).NotificationService(Swift)
NotificationService(Objective-C)
CleverTapAccountIDderived,来自 Features.CleverTap.AccountID
CleverTapTokenderived,来自 Features.CleverTap.Token
CleverTapRegionderived,来自 Features.CleverTap.Region
CleverTapDisableIDFVtrue
VGSDKAppGroupgroup.<App bundle id>
NSAppTransportSecurity{ NSAllowsArbitraryLoads: true }(NSE 会下载 ct_mediaUrl,可能是 http)

设置 NSE target(完成前下方代码无法编译):

  • App Groups: 在 NSE target → Signing & Capabilities+ Capability,添加 App Groups 并选择与 App 相同的 group.<App bundle id>。Xcode 会为你写入 entitlement。
  • Frameworks:CTNotificationService.xcframeworkCleverTapSDK.xcframework(来自 VGSDKResources/Frameworks)添加到此 target 并将两者设为 Embed & Sign

它的 principal class 继承自 CTNotificationServiceExtension

//  NotificationService.m
@import UserNotifications;
@import CTNotificationService;
@import CleverTapSDK;
 
@interface NotificationService : CTNotificationServiceExtension
@end
 
@implementation NotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request
                   withContentHandler:(void (^)(UNNotificationContent *))contentHandler {
    // Manual integration doesn't ship VGSDKNotificationService, so inline what
    // VGSDKNotification.recordImpression does: read the App Group + shared user id,
    // identify that user, then record the CleverTap "Notification Viewed" impression.
    NSString *group = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"VGSDKAppGroup"];
    NSUserDefaults *shared = group ? [[NSUserDefaults alloc] initWithSuiteName:group] : nil;
    NSString *userId = [shared stringForKey:@"VGSDK_SHARED_USER_ID"];
    if (userId) {
        [[CleverTap sharedInstance] onUserLogin:@{@"Identity": userId}];
        [[CleverTap sharedInstance] recordNotificationViewedEventWithData:request.content.userInfo];
    }
    [super didReceiveNotificationRequest:request withContentHandler:contentHandler];
}
@end

Don’t rename VGSDKAppGroup or VGSDK_SHARED_USER_ID. The SDK writes and reads these exact key names, and VGSDKAppGroup must hold the same App Group id as the host app (group.<app bundle id>). Change either name or use a different group, and the NSE records no impression.

請勿更改 VGSDKAppGroupVGSDK_SHARED_USER_ID SDK 會以這些確切的鍵名寫入與讀取,且 VGSDKAppGroup 必須填入與 host App 相同的 App Group idgroup.<App bundle id>)。只要更改其一或使用不同的 group,NSE 就不會記錄任何曝光。

请勿更改 VGSDKAppGroupVGSDK_SHARED_USER_ID SDK 会以这些确切的键名写入与读取,且 VGSDKAppGroup 必须填入与 host App 相同的 App Group idgroup.<App bundle id>)。只要更改其一或使用不同的 group,NSE 就不会记录任何曝光。

Notification Content extension (NCE)

Add the target in Xcode: File → New → Target… → Notification Content Extension, with bundle id <app bundle id>.NotificationContent. Keep the MainInterface.storyboard Xcode creates (you wire it below). Its Info.plist needs:

KeyValue
NSExtension.NSExtensionPointIdentifiercom.apple.usernotifications.content-extension
NSExtension.NSExtensionMainStoryboardMainInterface (its view controller’s Custom Class is set below)
NSExtension.NSExtensionAttributes{ UNNotificationExtensionCategory: "CTNotification", UNNotificationExtensionInitialContentSizeRatio: 0.1, UNNotificationExtensionDefaultContentHidden: true }
CleverTapAccountIDderived from Features.CleverTap.AccountID.
CleverTapTokenderived from Features.CleverTap.Token.
CleverTapRegionderived from Features.CleverTap.Region.
CleverTapDisableIDFVtrue

Set up the NCE target (the code below won’t compile until you do):

  • Frameworks: add CTNotificationContent.xcframework (from VGSDKResources/Frameworks) to this target and set it to Embed & Sign.
  • Storyboard: in MainInterface.storyboard, replace the default view with a plain UIView and set the view controller’s Custom Class to NotificationViewController.

That view controller subclasses CTNotificationViewController:

Notification Content 擴充功能(NCE)

在 Xcode 中新增 target:File → New → Target… → Notification Content Extension,bundle id 設為 <App bundle id>.NotificationContent。保留 Xcode 建立的 MainInterface.storyboard(你會在下方設定它)。它的 Info.plist 需要:

NSExtension.NSExtensionPointIdentifiercom.apple.usernotifications.content-extension
NSExtension.NSExtensionMainStoryboardMainInterface(其 view controller 的 Custom Class 於下方設定)
NSExtension.NSExtensionAttributes{ UNNotificationExtensionCategory: "CTNotification", UNNotificationExtensionInitialContentSizeRatio: 0.1, UNNotificationExtensionDefaultContentHidden: true }
CleverTapAccountIDderived,來自 Features.CleverTap.AccountID
CleverTapTokenderived,來自 Features.CleverTap.Token
CleverTapRegionderived,來自 Features.CleverTap.Region
CleverTapDisableIDFVtrue

設定 NCE target(完成前下方程式碼無法編譯):

  • Frameworks:CTNotificationContent.xcframework(來自 VGSDKResources/Frameworks)加入此 target 並設為 Embed & Sign
  • Storyboard:MainInterface.storyboard 中,將預設 view 換成一個純 UIView,並將 view controller 的 Custom Class 設為 NotificationViewController

該 view controller 繼承自 CTNotificationViewController

Notification Content 扩展(NCE)

在 Xcode 中新增 target:File → New → Target… → Notification Content Extension,bundle id 设为 <App bundle id>.NotificationContent。保留 Xcode 创建的 MainInterface.storyboard(你会在下方设置它)。它的 Info.plist 需要:

NSExtension.NSExtensionPointIdentifiercom.apple.usernotifications.content-extension
NSExtension.NSExtensionMainStoryboardMainInterface(其 view controller 的 Custom Class 于下方设置)
NSExtension.NSExtensionAttributes{ UNNotificationExtensionCategory: "CTNotification", UNNotificationExtensionInitialContentSizeRatio: 0.1, UNNotificationExtensionDefaultContentHidden: true }
CleverTapAccountIDderived,来自 Features.CleverTap.AccountID
CleverTapTokenderived,来自 Features.CleverTap.Token
CleverTapRegionderived,来自 Features.CleverTap.Region
CleverTapDisableIDFVtrue

设置 NCE target(完成前下方代码无法编译):

  • Frameworks:CTNotificationContent.xcframework(来自 VGSDKResources/Frameworks)添加到此 target 并设为 Embed & Sign
  • Storyboard:MainInterface.storyboard 中,将默认 view 换成一个纯 UIView,并将 view controller 的 Custom Class 设为 NotificationViewController

该 view controller 继承自 CTNotificationViewController

//  NotificationViewController.m
@import CTNotificationContent;
 
@interface NotificationViewController : CTNotificationViewController
@end
 
@implementation NotificationViewController
@end

Import the SDK

Import the SDK module:

匯入 SDK 模組:

导入 SDK 模块:

@import PassSDK;

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.

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

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

[[PassSDK shared] showLoginForm:^(PassUserInfo *info, NSError *error) {
    if (error != nil) {
        // handle failure
    } else {
        // info.userID, info.displayName, info.sessionID
    }
}];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
infoPassUserInfo?The signed-in player. Fields: PassUserInfo.
errorNSError?The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes.
欄位型別說明
infoPassUserInfo?成功時為已登入的使用者。取消或失敗時不存在。欄位:PassUserInfo
errorNSError?當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。
字段类型描述
infoPassUserInfo?成功时为已登录的用户。取消或失败时不存在。字段:PassUserInfo
errorNSError?当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。

Auto login

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

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

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

[[PassSDK shared] autoLogin:^(PassUserInfo *info, NSError *error) {
    // Same result fields as showLoginForm
}];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
infoPassUserInfo?The signed-in player. Fields: PassUserInfo.
errorNSError?The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes.
欄位型別說明
infoPassUserInfo?成功時為已登入的使用者。取消或失敗時不存在。欄位:PassUserInfo
errorNSError?當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。
字段类型描述
infoPassUserInfo?成功时为已登录的用户。取消或失败时不存在。字段:PassUserInfo
errorNSError?当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。

Direct login to a channel

Signs in to one channel directly, bypassing the picker.

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

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

[[PassSDK shared] directLogin:PassLoginTypeGoogle completion:^(PassUserInfo *info, NSError *error) {
    // Handle result
}];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
infoPassUserInfo?The signed-in player. Fields: PassUserInfo.
errorNSError?The failure reason when the player cancels or login fails: see VGA / Passport-legacy login error codes.
欄位型別說明
infoPassUserInfo?成功時為已登入的使用者。取消或失敗時不存在。欄位:PassUserInfo
errorNSError?當玩家取消或登入失敗時存在: 請參閱 VGA / Passport-legacy 登入錯誤碼。
字段类型描述
infoPassUserInfo?成功时为已登录的用户。取消或失败时不存在。字段:PassUserInfo
errorNSError?当玩家取消或登录失败时存在: 请参阅 VGA / Passport-legacy 登录错误码。

Log out

Signs the current player out and clears the stored session.

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

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

[[PassSDK shared] logout];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Check the login session (server-side only)

Validates a player’s session from YOUR game server, not from the client. After a login callback hands the game a userID and a sessionID, the game’s backend POSTs them to /api/login/checkSession as application/x-www-form-urlencoded, and trusts the player only when returnCode is 1. There is no SDK call for this and no client-side equivalent: a client can claim any session, which is the reason the check exists. The domain to send it to and your game’s secret key are issued on request, see below.

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

你的游戏服务器验证玩家的会话,而不是从客户端。登录回调把 userIDsessionID 交给游戏之后,游戏的后端以 application/x-www-form-urlencoded 将两者 POST 到 /api/login/checkSession,只有在 returnCode1 时才信任该玩家。SDK 没有对应的调用,客户端也没有等价做法:客户端可以声称任何会话,这正是需要这道检查的原因。要发往的域名与你的游戏 secret key 需另行申请,见下方说明。

# Domain and secret key come from your server's environment, never from a literal.
TIMESTAMP=$(date +%s)
SIG=$(printf '%s%s%s%s%s' "$VGA_SECRET_KEY" "$GAME_ID" "$USER_ID" "$TIMESTAMP" "$SESSION_ID" | md5sum | cut -d' ' -f1)
 
curl -X POST "$VGA_DOMAIN/api/login/checkSession" \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode "gameID=$GAME_ID" \
  --data-urlencode "userID=$USER_ID" \
  --data-urlencode "sessionID=$SESSION_ID" \
  --data-urlencode "timestamp=$TIMESTAMP" \
  --data-urlencode "sig=$SIG"

Server-side only. The path is /api/login/checkSession, but the DOMAIN and your game’s secret key are not published here. Email pin.sdk.dev@vng.com.vn to be issued both. The secret key must never ship in a game client.

僅限伺服器端。 路徑為 /api/login/checkSession,但網域與你的遊戲 secret key 不會公開在這裡,請來信 pin.sdk.dev@vng.com.vn 索取。secret key 絕對不可以隨遊戲用戶端一起發布。

仅限服务器端。 路径为 /api/login/checkSession,但域名与你的游戏 secret key 不会公开在这里,请来信 pin.sdk.dev@vng.com.vn 索取。secret key 绝对不可以随游戏客户端一起发布。

Input

輸入

输入

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

Output

輸出

输出

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

Is delete-account enabled

Reports whether the current account supports self-service deletion, so the game can show/hide the entry point.

回報目前帳號是否支援自助刪除,讓遊戲可據此顯示或隱藏入口。

报告当前账号是否支持自助删除,以便游戏据此显示或隐藏入口。

Account deletion applies to Direct login accounts only.

帳號刪除僅適用於 Direct login 帳號。

账号删除仅适用于 Direct login 账号。

if ([[PassSDK shared] deleteAccountEnabled]) {
    // Show the delete-account entry point
}

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
enabledBooltrue when self-service deletion is available for the current account.
欄位型別說明
enabledBool當目前帳號可使用自助刪除時為 true。
字段类型描述
enabledBool当当前账号可使用自助删除时为 true。

Delete account

Runs the account-deletion flow.

執行帳號刪除流程。

执行账号删除流程。

Account deletion applies to Direct login accounts only.

帳號刪除僅適用於 Direct login 帳號。

账号删除仅适用于 Direct login 账号。

[[PassSDK shared] deleteAccount:^(BOOL success) {
    // YES when the account was deleted
}];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
successBooltrue when the account was successfully deleted.
欄位型別說明
successBool當帳號成功刪除時為 true。
字段类型描述
successBool当账号成功删除时为 true。

Quick Authentication

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

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

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

v1

Quick login

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

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

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

[[PassSDK shared] quickLogin:^(PassUserInfo *info, NSError *error) {
    // Signed in, or error on failure
}];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
infoPassUserInfo?The signed-in player. Fields: PassUserInfo.
errorNSError?The failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
infoPassUserInfo?成功時為已登入的使用者。取消或失敗時不存在。欄位:PassUserInfo
errorNSError?當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
infoPassUserInfo?成功时为已登录的用户。取消或失败时不存在。字段:PassUserInfo
errorNSError?当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

v2

Sign in

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

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

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

VGSDKAuthenticationListener *listener = [[VGSDKAuthenticationListener alloc]
    initWithOnSuccess:^(PassUserInfo * _Nonnull info) { /* signed in */ }
    onError:^(NSError * _Nonnull error) { /* failed */ }];
[VGSDKQuickAuth showLoginWithListener:listener];

Input

輸入

输入

FieldTypeDescription
listenerVGSDKAuthenticationListenerResult listener (onSuccess/onError).
listener.onSuccess(PassUserInfo) -> VoidCalled with the signed-in user.
listener.onError(NSError) -> VoidCalled with the failure reason.
欄位型別說明
listenerVGSDKAuthenticationListener結果監聽器(onSuccess/onError)。
listener.onSuccess(PassUserInfo) -> Void以已登入的使用者呼叫。
listener.onError(NSError) -> Void以失敗原因呼叫。
字段类型描述
listenerVGSDKAuthenticationListener结果监听器(onSuccess/onError)。
listener.onSuccess(PassUserInfo) -> Void以已登录的用户调用。
listener.onError(NSError) -> Void以失败原因调用。

Output

輸出

输出

FieldTypeDescription
onSuccessPassUserInfoThe signed-in player. Fields: PassUserInfo.
onErrorNSErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
onSuccessPassUserInfo已登入使用者,必定存在。欄位:PassUserInfo
onErrorNSError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
onSuccessPassUserInfo已登录用户,必定存在。字段:PassUserInfo
onErrorNSError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

Play as guest

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

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

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

[VGSDKQuickAuth playAsGuestWithListener:listener];

Input

輸入

输入

FieldTypeDescription
listenerVGSDKAuthenticationListenerResult listener (onSuccess/onError).
欄位型別說明
listenerVGSDKAuthenticationListener結果監聽器(onSuccess/onError)。
字段类型描述
listenerVGSDKAuthenticationListener结果监听器(onSuccess/onError)。

Output

輸出

输出

FieldTypeDescription
onSuccessPassUserInfoThe signed-in player. Fields: PassUserInfo.
onErrorNSErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
onSuccessPassUserInfo訪客使用者,必定存在。欄位:PassUserInfo
onErrorNSError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
onSuccessPassUserInfo访客用户,必定存在。字段:PassUserInfo
onErrorNSError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

Show channel selection

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

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

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

[VGSDKQuickAuth showChannelSelectionWithListener:listener];

Input

輸入

输入

FieldTypeDescription
listenerVGSDKAuthenticationListenerResult listener (onSuccess/onError).
欄位型別說明
listenerVGSDKAuthenticationListener結果監聽器(onSuccess/onError)。
字段类型描述
listenerVGSDKAuthenticationListener结果监听器(onSuccess/onError)。

Output

輸出

输出

FieldTypeDescription
onSuccessPassUserInfoThe signed-in player. Fields: PassUserInfo.
onErrorNSErrorThe failure reason when the player cancels or login fails: see VGA login error codes.
欄位型別說明
onSuccessPassUserInfo已登入使用者,必定存在。欄位:PassUserInfo
onErrorNSError當玩家取消或登入失敗時的失敗原因: 請參閱 VGA 登入錯誤碼
字段类型描述
onSuccessPassUserInfo已登录用户,必定存在。字段:PassUserInfo
onErrorNSError当玩家取消或登录失败时的失败原因: 请参阅 VGA 登录错误码

Manage account

Open account management

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

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

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

[[PassSDK shared] manageAccount:^(PassManageAccountAction action, PassUserInfo *info) { }];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
actionPassManageAccountActionThe action the player took. See PassManageAccountAction.
infoPassUserInfo?The signed-in player. Fields: PassUserInfo.
欄位型別說明
actionPassManageAccountAction玩家執行的操作。請參閱 PassManageAccountAction
infoPassUserInfo?管理後產生的使用者。若未變更/已取消則不存在。欄位:PassUserInfo
字段类型描述
actionPassManageAccountAction玩家执行的操作。请参阅 PassManageAccountAction
infoPassUserInfo?管理后得到的用户,若未更改 / 取消则不存在。字段:PassUserInfo

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

[VGSDKPayment getProductsWithIds:@[@"item-1"] listener:^(NSArray<VGSDKPaymentProduct *> *products, NSError *error) {
    if (products == nil || error != nil) { return; }
    // Use product.displayPrice to render the price
}];

Input

輸入

输入

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

Output

輸出

输出

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

Purchase

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

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

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

VGSDKPaymentInfo *info = [[VGSDKPaymentInfo alloc]
    initWithUserId:@"user-1" itemId:@"item-1" serverId:@"server-1"
    roleId:@"role-1" appTransactionId:@"txn-1" addInfo:@""];
[VGSDKPayment purchaseWithInfo:info listener:^(VGSDKPaymentPurchaseStatus status, NSError *error) {
    switch (status) {
        case VGSDKPaymentPurchaseStatusSuccess: break; // granted
        case VGSDKPaymentPurchaseStatusPending: break; // awaiting external confirmation
        default: break;
    }
}];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
statusVGSDKPaymentPurchaseStatusPurchase outcome: see VGSDKPaymentPurchaseStatus.
errorError?Purchase failed. See billing / store payment error codes.
欄位型別說明
statusVGSDKPaymentPurchaseStatus購買結果: 請參閱 VGSDKPaymentPurchaseStatus
errorError?購買失敗。請參閱 帳務商店 付款錯誤碼。
字段类型描述
statusVGSDKPaymentPurchaseStatus购买结果: 请参阅 VGSDKPaymentPurchaseStatus
errorError?购买失败。请参阅 计费商店 支付错误码。

Analytics

One facade for every analytics provider, organised by use case. Configure analytics first, then send ad-hoc custom events or the structured use-case funnels (Conversion Rate = app launch → play, Onboarding = new user → early monetization, Main & Daily Activities, Social & Communities). Providers: AppsFlyer, Firebase, Data Platform, Facebook, CleverTap, ThinkingData. Every call is fire-and-forget. Every event also carries a set of default parameters the SDK fills in automatically: see Analytics default parameters.

Notice: Every event the VNGGames SDK APIs trigger starts with the vgsdk_ prefix and follows the formula vgsdk_{prefix}_{event name}: for example, vgsdk_af_app_open. See Analytics platform prefixes.

涵蓋所有分析供應商的單一門面,依使用情境組織。請先設定分析,然後傳送臨時的自訂事件,或使用結構化的使用情境漏斗(Conversion Rate=應用程式啟動 → 遊玩、Onboarding=新使用者 → 早期營利、Main & Daily Activities、Social & Communities)。供應商:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每個呼叫都是 fire-and-forget。每個事件還會帶有一組由 SDK 自動填入的預設參數: 請參閱 分析預設參數

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

面向所有分析提供方的统一门面,按使用场景组织。先配置分析,然后发送临时自定义事件或结构化的使用场景漏斗(Conversion Rate = 应用启动 → 游玩,Onboarding = 新用户 → 早期变现,Main & Daily Activities,Social & Communities)。提供方:AppsFlyer、Firebase、Data Platform、Facebook、CleverTap、ThinkingData。每次调用都是 fire-and-forget。每个事件还会携带一组由 SDK 自动填充的默认参数: 请参阅 分析默认参数

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

Setup

Configure analytics

Required analytics setup: binds the current role id and name to the analytics session so tracked events carry role context. Call once after login, before sending events.

必要的分析設定:將目前的角色 ID 與名稱綁定到分析工作階段,讓追蹤的事件帶有角色情境。請在登入後、傳送事件前呼叫一次。

必需的分析设置:将当前角色 id 和名称绑定到分析会话,使追踪的事件带有角色上下文。登录后、发送事件前调用一次。

Required setup for analytics.

分析的必要設定。

分析的必需设置。

[VGSDKAnalytics miscConfigAnalytics:@"role-1" roleName:@"Hero"];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Integration Limitations

Rules & limits

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

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

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

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

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

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

Custom event

Send a custom event

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

VGSDKAnalyticsPlatform *facebook = [[VGSDKAnalyticsPlatform alloc]
    initWithProvider:VGSDKAnalyticsProviderFacebook prefix:@""];
[VGSDKAnalytics sendCustomEvent:@"level_up" parameters:@{@"level": @5} platforms:@[facebook]];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Misc: custom event

Sends a custom event to the SDK’s default provider set: the no-platform-list counterpart of sendCustomEvent (you don’t pick providers). The SDK auto-prefixes the event name per provider, delivering it as vgsdk_{prefix}_{event name}: see Analytics platform prefixes.

將自訂事件傳送到 SDK 的預設供應商集合: 為 sendCustomEvent 不帶平台清單的對應版本(你不需選擇供應商)。SDK 會依各供應商自動為事件名稱加上前綴,以 vgsdk_{prefix}_{event name} 傳遞: 請參閱 分析平台前綴

向 SDK 的默认提供方集合发送一个自定义事件: 即 sendCustomEvent 的无 platforms 列表版本(你不选择提供方)。SDK 会为每个提供方自动为事件名称添加前缀,以 vgsdk_{prefix}_{event name} 形式发送: 请参阅 分析平台前缀

[VGSDKAnalytics miscCustomEvent:@"my_event" parameters:@{@"k": @"v"}];

Input

輸入

输入

FieldTypeDescription
nameStringEvent name.
parameters[String: Any]Event parameters.
欄位型別說明
nameString事件名稱。
parameters[String: Any]事件參數。
字段类型描述
nameString事件名称。
parameters[String: Any]事件参数。

Output

輸出

输出

No return value (fire-and-forget).

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

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

Conversion Rate

1. App open

Logs an app open.

記錄一次應用程式開啟。

记录一次应用打开。

[VGSDKAnalytics regAppOpen:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

2. Get configuration

Logs the configuration fetch.

記錄設定的取得。

记录配置获取。

[VGSDKAnalytics regGetConfiguration:@{}];

Input

輸入

输入

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

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:@{}];

Input

輸入

输入

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

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:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

4. Tutorial start

Logs the tutorial starting.

記錄教學開始。

记录教程开始。

[VGSDKAnalytics nruTutorialStart:@"role-1" serverId:@"server-1" progress:@"0" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" progress:@"25" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" progress:@"50" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" progress:@"75" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

6. Tutorial finish

Logs tutorial completion.

記錄教學完成。

记录教程完成。

[VGSDKAnalytics nruTutorialProgressFinish:@"role-1" serverId:@"server-1" progress:@"100" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" itemId:@"item-1" itemName:@"Gold" itemPrice:@"22000" itemCurrency:@"VND" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Purchased item

Logs a completed purchase.

記錄一次完成的購買。

记录一次完成的购买。

[VGSDKAnalytics iapPurchasedItem:@"role-1" serverId:@"server-1" itemId:@"item-1"
    itemName:@"Gold Pack" itemPrice:@"22000" itemCurrency:@"VND" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" currentVipLevel:@"3" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" itemId:@"item-1" itemName:@"VIP Pack" itemVipLevel:@"3" itemPrice:@"22000" itemCurrency:@"VND" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" currentLevel:@"42" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

7. Agree to terms

Logs acceptance of all terms.

記錄同意所有條款。

记录接受所有条款。

[VGSDKAnalytics nruAgreeAllTerm:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" mainQuestId:@"q1" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Daily quest

Logs daily-quest progress.

記錄每日任務的進度。

记录每日任务进度。

[VGSDKAnalytics mdaDailyQuest:@"role-1" serverId:@"server-1" dailyQuestId:@"d1" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" dailyRewardId:@"r1" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" itemId:@"item-1" itemName:@"Potion" itemPrice:@"100" itemCurrency:@"gold" itemQuantity:@"5" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Spend item

Logs spending/consuming an item.

記錄花費/消耗道具。

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

[VGSDKAnalytics mdaSpendItem:@"role-1" serverId:@"server-1" itemId:@"item-1" itemName:@"Potion" itemPrice:@"100" itemCurrency:@"gold" itemQuantity:@"5" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Gacha

Logs a gacha pull.

記錄一次轉蛋抽取。

记录一次抽卡。

[VGSDKAnalytics mdaGacha:@"role-1" serverId:@"server-1" gachaType:@"banner-a" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" guildId:@"g1" guildName:@"Guild" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Join guild

Logs a guild-join event.

記錄一次加入公會事件。

记录一次加入公会事件。

[VGSDKAnalytics scJoinGuild:@"role-1" serverId:@"server-1" guildId:@"g1" guildName:@"Guild" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Quit guild

Logs a guild-quit event.

記錄一次退出公會事件。

记录一次退出公会事件。

[VGSDKAnalytics scQuitGuild:@"role-1" serverId:@"server-1" guildId:@"g1" guildName:@"Guild" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" platform:@"facebook" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" platform:@"facebook" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

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" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Other

Splash screen

Logs the splash screen being shown.

記錄啟動畫面被顯示。

记录启动画面的展示。

[VGSDKAnalytics regSplashScreen:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Purchase canceled

Logs a canceled purchase.

記錄一次已取消的購買。

记录一次已取消的购买。

[VGSDKAnalytics iapPurchasedCanceledItem:@"role-1" serverId:@"server-1" itemId:@"item-1" itemName:@"Gold" itemPrice:@"22000" itemCurrency:@"VND" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Switch account

Logs an account switch.

記錄一次帳號切換。

记录一次账号切换。

[VGSDKAnalytics miscSwitchAccount:@"role-1" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Customer support

Logs a customer-support entry.

記錄一次進入客戶支援。

记录一次进入客户支持。

[VGSDKAnalytics miscCustomerSupport:@"role-1" serverId:@"server-1" extraData:@{}];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Ad revenue

Reports ad revenue through the unified analytics facade.

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

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

[VGSDKAnalytics miscAdRevenue:@"AdMob"
    mediationNetwork:VGSDKAdRevenueMediationNetworkGoogleAdMob
    revenue:22000 currencyCode:@"VND" extraData:@{}];

Input

輸入

输入

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

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 = [[VGSDKSupportInfo alloc]
    initWithUserId:@"user-1" serverId:@"server-1" level:@"10" roleName:@"role"
    loginChannel:@"vga" guild:@"guild" content:@"Need help"];
VGSDKSupportCenterListener *listener = [[VGSDKSupportCenterListener alloc] init];
listener.onAction = ^(NSDictionary *data) { };
listener.onClosed = ^{ };
listener.onError = ^(VGSDKError *error) { };
[VGSDKSupport openSupportCenterWithInfo:info listener:listener];

Input

輸入

输入

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

Output

輸出

输出

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

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。

PassIronSourceListener *initListener = [[PassIronSourceListener alloc] init];
initListener.onCompleted = ^{ };
initListener.onFailed = ^(NSError *error) { };
 
PassIronSourceLevelPlayRewardedVideoListener *rvListener = [[PassIronSourceLevelPlayRewardedVideoListener alloc] init];
rvListener.didReceiveReward = ^(ISPlacementInfo *placement, ISAdInfo *adInfo) { /* grant reward */ };
 
[VGSDKIronSource initIronSourceWithUserID:@"user-1" listener:initListener rewardedVideoListener:rvListener];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
initListener.onCompleted(() -> Void)?Initialization finished: ironSource is ready.
initListener.onFailed((NSError) -> Void)?Initialization failed: see In-app ads error codes.
didReceiveReward((ISPlacementInfo, ISAdInfo) -> Void)?Reward earned: grant it here.
hasAvailableAd((ISAdInfo) -> Void)?An ad is available.
hasNoAvailableAd(() -> Void)?No ad available.
didOpen((ISAdInfo) -> Void)?Ad opened.
didClick((ISPlacementInfo, ISAdInfo) -> Void)?Ad clicked.
didClose((ISAdInfo) -> Void)?Ad closed.
didFailToShowWithError((Error, ISAdInfo) -> Void)?Ad failed to show: carries the underlying ironSource error (its native code, not a VGSDK code).
onFailed((NSError) -> Void)?A pre-show check failed (placement not matched / capped, or no view controller to present): see In-app ads error codes.
欄位型別說明
initListener.onCompleted(() -> Void)?初始化完成: ironSource 已就緒。
initListener.onFailed((NSError) -> Void)?初始化失敗: 請參閱 應用程式內廣告錯誤碼
didReceiveReward((ISPlacementInfo, ISAdInfo) -> Void)?獲得的獎勵: 在此發放。
hasAvailableAd((ISAdInfo) -> Void)?有可用的廣告。
hasNoAvailableAd(() -> Void)?沒有可用的廣告。
didOpen((ISAdInfo) -> Void)?廣告已開啟。
didClick((ISPlacementInfo, ISAdInfo) -> Void)?廣告被點擊。
didClose((ISAdInfo) -> Void)?廣告已關閉。
didFailToShowWithError((Error, ISAdInfo) -> Void)?廣告顯示失敗: 帶有底層的 ironSource 錯誤(其原生代碼,非 VGSDK 代碼)。
onFailed((NSError) -> Void)?顯示前檢查失敗(版位不符/已達上限,或沒有可用於呈現的控制器): 請參閱 應用程式內廣告錯誤碼
字段类型描述
initListener.onCompleted(() -> Void)?初始化完成: ironSource 已就绪。
initListener.onFailed((NSError) -> Void)?初始化失败: 请参阅 应用内广告错误码
didReceiveReward((ISPlacementInfo, ISAdInfo) -> Void)?获得的奖励: 在此发放。
hasAvailableAd((ISAdInfo) -> Void)?有可用的广告。
hasNoAvailableAd(() -> Void)?没有可用的广告。
didOpen((ISAdInfo) -> Void)?广告已打开。
didClick((ISPlacementInfo, ISAdInfo) -> Void)?广告被点击。
didClose((ISAdInfo) -> Void)?广告已关闭。
didFailToShowWithError((Error, ISAdInfo) -> Void)?广告展示失败: 携带底层的 ironSource 错误(其原生代码,非 VGSDK 代码)。
onFailed((NSError) -> Void)?展示前检查失败(广告位不匹配/已达上限,或没有可用于呈现的控制器): 请参阅 应用内广告错误码

Show rewarded video

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

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

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

PassIronSourceRewardedVideo *video = [[PassIronSourceRewardedVideo alloc]
    initWithPlacementName:@"Main" trackReachability:YES];
[VGSDKIronSource showRewardedVideo:video];

Input

輸入

输入

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

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。

[VGSDKIronSource setDynamicUserID:@"user-1"];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

Meta Audience Network

Show interstitial

Shows a Meta Audience Network interstitial.

顯示 Meta Audience Network 插頁式廣告。

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

VGSDKMetaAdsInterstitialListener *listener = [[VGSDKMetaAdsInterstitialListener alloc] init];
[VGSDKMetaAds showInterstitial:@"placement-id" listener:listener];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
didFailToLoad((FBInterstitialAd, Error) -> Void)?Load failed: VGSDK metaAdInvalid (9048, invalid ad or no view controller: see In-app ads error codes) on the SDK’s post-load check, otherwise the raw native Meta error.
didClick((FBInterstitialAd) -> Void)?Ad clicked.
willClose((FBInterstitialAd) -> Void)?About to close.
didClose((FBInterstitialAd) -> Void)?Ad closed.
willLogImpression((FBInterstitialAd) -> Void)?Impression logged.
欄位型別說明
didFailToLoad((FBInterstitialAd, Error) -> Void)?載入失敗: SDK 載入後檢查失敗時為 VGSDK metaAdInvalid(9048。廣告無效或無可呈現的控制器: 請參閱 應用程式內廣告錯誤碼),否則為原生 Meta 錯誤。
didClick((FBInterstitialAd) -> Void)?廣告被點擊。
willClose((FBInterstitialAd) -> Void)?即將關閉。
didClose((FBInterstitialAd) -> Void)?廣告已關閉。
willLogImpression((FBInterstitialAd) -> Void)?已記錄曝光。
字段类型描述
didFailToLoad((FBInterstitialAd, Error) -> Void)?加载失败: SDK 加载后检查失败时为 VGSDK metaAdInvalid(9048。广告无效或无可呈现的控制器: 请参阅 应用内广告错误码),否则为原生 Meta 错误。
didClick((FBInterstitialAd) -> Void)?广告被点击。
willClose((FBInterstitialAd) -> Void)?即将关闭。
didClose((FBInterstitialAd) -> Void)?广告已关闭。
willLogImpression((FBInterstitialAd) -> Void)?已记录曝光。

Show rewarded video

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

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

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

VGSDKMetaAdsRewardedVideoListener *listener = [[VGSDKMetaAdsRewardedVideoListener alloc] init];
listener.complete = ^(FBRewardedVideoAd *ad) { /* grant reward */ };
[VGSDKMetaAds showRewardedVideo:@"placement-id" userId:@"user-1" currency:@"gold" listener:listener];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
complete((FBRewardedVideoAd) -> Void)?Reward earned: grant it here.
didFailToLoad((FBRewardedVideoAd, Error) -> Void)?Load failed: VGSDK metaAdInvalid (9048, invalid ad or no view controller: see In-app ads error codes) on the SDK’s post-load check, otherwise the raw native Meta error.
didClose((FBRewardedVideoAd) -> Void)?Ad closed.
didClick((FBRewardedVideoAd) -> Void)?Ad clicked.
欄位型別說明
complete((FBRewardedVideoAd) -> Void)?獲得的獎勵: 在此發放。
didFailToLoad((FBRewardedVideoAd, Error) -> Void)?載入失敗: SDK 載入後檢查失敗時為 VGSDK metaAdInvalid(9048。廣告無效或無可呈現的控制器: 請參閱 應用程式內廣告錯誤碼),否則為原生 Meta 錯誤。
didClose((FBRewardedVideoAd) -> Void)?廣告已關閉。
didClick((FBRewardedVideoAd) -> Void)?廣告被點擊。
字段类型描述
complete((FBRewardedVideoAd) -> Void)?获得的奖励: 在此发放。
didFailToLoad((FBRewardedVideoAd, Error) -> Void)?加载失败: SDK 加载后检查失败时为 VGSDK metaAdInvalid(9048。广告无效或无可呈现的控制器: 请参阅 应用内广告错误码),否则为原生 Meta 错误。
didClose((FBRewardedVideoAd) -> Void)?广告已关闭。
didClick((FBRewardedVideoAd) -> Void)?广告被点击。

Show rewarded interstitial

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

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

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

VGSDKMetaAdsRewardedInterstitialListener *listener = [[VGSDKMetaAdsRewardedInterstitialListener alloc] init];
listener.complete = ^(FBRewardedInterstitialAd *ad) { /* grant reward */ };
[VGSDKMetaAds showRewardedInterstitial:@"placement-id" userId:@"user-1" currency:@"gold" listener:listener];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
complete((FBRewardedInterstitialAd) -> Void)?Reward earned: grant it here.
didClose((FBRewardedInterstitialAd) -> Void)?Ad closed.
didFailToLoad((FBRewardedInterstitialAd, Error) -> Void)?Load failed: VGSDK metaAdInvalid (9048, invalid ad or no view controller: see In-app ads error codes) on the SDK’s post-load check, otherwise the raw native Meta error.
欄位型別說明
complete((FBRewardedInterstitialAd) -> Void)?獲得的獎勵: 在此發放。
didClose((FBRewardedInterstitialAd) -> Void)?廣告已關閉。
didFailToLoad((FBRewardedInterstitialAd, Error) -> Void)?載入失敗: SDK 載入後檢查失敗時為 VGSDK metaAdInvalid(9048。廣告無效或無可呈現的控制器: 請參閱 應用程式內廣告錯誤碼),否則為原生 Meta 錯誤。
字段类型描述
complete((FBRewardedInterstitialAd) -> Void)?获得的奖励: 在此发放。
didClose((FBRewardedInterstitialAd) -> Void)?广告已关闭。
didFailToLoad((FBRewardedInterstitialAd, Error) -> Void)?加载失败: SDK 加载后检查失败时为 VGSDK metaAdInvalid(9048。广告无效或无可呈现的控制器: 请参阅 应用内广告错误码),否则为原生 Meta 错误。

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 监听器。

PassCleverTapListener *listener = [[PassCleverTapListener alloc] init];
listener.inAppNotificationButtonTapped = ^(NSDictionary *payload) { };
[VGSDKCleverTap setListener:listener];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
inAppNotificationButtonTapped([AnyHashable: Any])Payload of the tapped in-app message button.
欄位型別說明
inAppNotificationButtonTapped([AnyHashable: Any])被點擊的應用程式內訊息按鈕的負載。
字段类型描述
inAppNotificationButtonTapped([AnyHashable: Any])被点击的应用内消息按钮的负载。

Open the app inbox

Opens the CleverTap-backed inbox.

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

打开由 CleverTap 支持的收件箱。

VGSDKAppInboxCleverTapProvider *provider = [[VGSDKAppInboxCleverTapProvider alloc] initWithStyle:nil];
VGSDKAppInboxListener *listener = [[VGSDKAppInboxListener alloc] init];
listener.onItemClicked = ^(CleverTapInboxMessage *message, CleverTapInboxMessageContent *content, NSDictionary *cta) { };
[VGSDKAppInbox openWithProvider:provider listener:listener];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
onItemClicked((CleverTapInboxMessage, CleverTapInboxMessageContent?, [AnyHashable: Any]?) -> Void)?The tapped message, its content, and any CTA button payload.
欄位型別說明
onItemClicked((CleverTapInboxMessage, CleverTapInboxMessageContent?, [AnyHashable: Any]?) -> Void)?被點擊的訊息、其內容,以及任何 CTA 負載。
字段类型描述
onItemClicked((CleverTapInboxMessage, CleverTapInboxMessageContent?, [AnyHashable: Any]?) -> Void)?被点击的消息、其内容以及任何 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 = [[VGSDKGameContext alloc] initWithRoleId:@"role-1" serverId:@"server-1"];
[VGSDK setGameContextWithContext:context];

Input

輸入

输入

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

Output

輸出

输出

No return value (fire-and-forget).

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

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

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

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

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

VGSDKInAppMessageDeepLinkListener *deepLink = [[VGSDKInAppMessageDeepLinkListener alloc] init];
deepLink.onDeepLink = ^(NSString *url) { /* route it */ };
[VGSDKAppInbox setInAppMessageDeepLinkListenerWithListener:deepLink];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
onDeepLink(String)The deep-link URL string to route.
欄位型別說明
onDeepLink(String)要路由的深層連結 URL 字串。
字段类型描述
onDeepLink(String)要路由的深链 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 键。

[VGSDKFirebase fetchRemoteConfig:^(NSDictionary<NSString *, NSString *> *config, NSError *error) {
    // Read config[@"your_key"]
}];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
config[String: String]?All remote-config keys and values.
errorError?Present on failure: VGSDK firebaseUnsupported (9047, see General error codes) when the Firebase dependency is missing, otherwise the raw native Firebase Remote Config error (fetch/activate failure).
欄位型別說明
config[String: String]?所有遠端設定的鍵與值。
errorError?失敗時存在: 缺少 Firebase 相依套件時為 VGSDK firebaseUnsupported(9047。請參閱 一般錯誤碼),否則為原生 Firebase Remote Config 錯誤(fetch/activate 失敗)。
字段类型描述
config[String: String]?所有远程配置的键与值。
errorError?失败时存在: 缺少 Firebase 依赖时为 VGSDK firebaseUnsupported(9047。请参阅 通用错误码),否则为原生 Firebase Remote Config 错误(fetch/activate 失败)。

In-App WebView

Show in-app WebView

Opens a URL in an in-app WebView.

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

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

[[PassSDK shared] showWebViewWith:@"https://example.com" completion:^{
    // WebView dismissed
}];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
completion() -> VoidFires when the WebView is dismissed.
欄位型別說明
completion() -> Void當 WebView 關閉時觸發。
字段类型描述
completion() -> Void当 WebView 关闭时触发。

Notification

Add a custom sound

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

  1. Prepare the sound file: .caf / .aiff / .wav, ≤ 30 seconds (longer sounds fall back to the system default).
  2. Add it to your app target so it ships inside the app bundle (Xcode → your target → Build Phases → Copy Bundle Resources).
  3. Reference it by full filename (e.g. my_notification.caf) in the push payload’s sound field.

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

  1. 準備音效檔.caf / .aiff / .wav≤ 30 秒(更長的音效會回退為系統預設音效)。
  2. 將其加入你的 app target,使其打包進 app bundle(Xcode → 你的 target → Build Phases → Copy Bundle Resources)。
  3. 於推播負載的 sound 欄位中以完整檔名參照它(例如 my_notification.caf)。

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

  1. 准备声音文件.caf / .aiff / .wav≤ 30 秒(更长的声音会回退为系统默认声音)。
  2. 将其添加到你的 app target,使其打包进 app bundle(Xcode → 你的 target → Build Phases → Copy Bundle Resources)。
  3. 在推送负载的 sound 字段中按完整文件名引用它(例如 my_notification.caf)。

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 资料。

[VGSDKFacebook getProfile:^(NSDictionary<NSString *, id> *profile, NSError *error) {
    // profile[@"id"], profile[@"name"], profile[@"picture"]
}];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
profile[String: Any]?Raw Graph profile dictionary. Absent on error.
profile["id"]StringFacebook user id.
profile["name"]StringDisplay name.
profile["picture"]AnyPicture object (Graph shape).
errorNSError?Present on failure: the raw native Facebook error (login or Graph request), or undefined (9000) on an invalid access token. See General error codes.
欄位型別說明
profile[String: Any]?原始的 Graph 個人檔案字典。發生錯誤時不存在。
profile["id"]StringFacebook 使用者 ID。
profile["name"]String顯示名稱。
profile["picture"]Any圖片物件(Graph 結構)。
errorNSError?失敗時存在: 原生 Facebook 錯誤(登入或 Graph 請求),或存取權杖無效時為 undefined(9000)。請參閱 一般錯誤碼
字段类型描述
profile[String: Any]?原始 Graph 资料字典。出错时不存在。
profile["id"]StringFacebook 用户 id。
profile["name"]String显示名称。
profile["picture"]Any头像对象(Graph 结构)。
errorNSError?失败时存在: 原生 Facebook 错误(登录或 Graph 请求),或访问令牌无效时为 undefined(9000)。请参阅 通用错误码

Get Facebook friends

Returns friends using the app as raw Graph dictionaries.

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

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

[VGSDKFacebook getFriendWithOffset:0 count:50
    completion:^(NSArray<NSDictionary<NSString *, id> *> *friends, NSError *error) { }];

Input

輸入

输入

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

Output

輸出

输出

FieldTypeDescription
friends[[String: Any]]?Array of friend dictionaries (id / name / picture keys). Absent on error.
errorNSError?Present on failure: the raw native Facebook error (login or Graph request), or cancelLogin (9003) if the player cancels the re-login prompt. See General error codes. Unlike Get Facebook profile, an invalid access token is not mapped to undefined (9000).
欄位型別說明
friends[[String: Any]]?好友字典的陣列(id/name/picture 鍵)。發生錯誤時不存在。
errorNSError?失敗時存在: 原生 Facebook 錯誤(登入或 Graph 請求),或玩家取消重新登入時為 cancelLogin(9003)。請參閱 一般錯誤碼。與「取得 Facebook 個人檔案」不同,存取權杖無效不會對應為 undefined(9000)。
字段类型描述
friends[[String: Any]]?好友字典数组(含 id / name / picture 键)。出错时不存在。
errorNSError?失败时存在: 原生 Facebook 错误(登录或 Graph 请求),或玩家取消重新登录时为 cancelLogin(9003)。请参阅 通用错误码。与“获取 Facebook 资料”不同,访问令牌无效不会映射为 undefined(9000)。

Invite Facebook friends

Opens the Facebook invite dialog.

開啟 Facebook 邀請對話框。

打开 Facebook 邀请对话框。

[VGSDKFacebook inviteFriend:@"Play with me" message:@"Join!"
    filter:PassFBInvitationFilterAppUsers
    completion:^(NSDictionary<NSString *, id> *result, NSError *error) { }];

Input

輸入

输入

FieldTypeDescription
titleString?Dialog title.
messageString?Invite message shown in the dialog.
filterPassFBInvitationFilterAudience filter: see PassFBInvitationFilter.
欄位型別說明
titleString?對話框標題。
messageString?在對話框中顯示的邀請訊息。
filterPassFBInvitationFilter受眾篩選: 請參閱 PassFBInvitationFilter
字段类型描述
titleString?对话框标题。
messageString?在对话框中显示的邀请消息。
filterPassFBInvitationFilter受众筛选: 请参阅 PassFBInvitationFilter

Output

輸出

输出

FieldTypeDescription
result[String: Any]?Dialog result dictionary. Absent on error/cancel.
errorNSError?Present on failure: a VGSDK code on a guard or cancel (see Social error codes), otherwise the raw native Facebook error (share/invite dialog or re-auth failure).
欄位型別說明
result[String: Any]?對話框結果字典。發生錯誤/取消時不存在。
errorNSError?失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。
字段类型描述
result[String: Any]?对话框结果字典。出错 / 取消时不存在。
errorNSError?失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。

Share photo to Facebook

Shares a photo through the Facebook share dialog.

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

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

[VGSDKFacebook sharePhoto:image completion:^(NSDictionary<NSString *, id> *result, NSError *error) { }];

Input

輸入

输入

FieldTypeDescription
imageUIImage?Image to share.
欄位型別說明
imageUIImage?要分享的相片。
字段类型描述
imageUIImage?要分享的照片。

Output

輸出

输出

FieldTypeDescription
result[String: Any]?Dialog result dictionary. Absent on error/cancel.
errorNSError?Present on failure: a VGSDK code on a guard or cancel (see Social error codes), otherwise the raw native Facebook error (share/invite dialog or re-auth failure).
欄位型別說明
result[String: Any]?對話框結果字典。發生錯誤/取消時不存在。
errorNSError?失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。
字段类型描述
result[String: Any]?对话框结果字典。出错 / 取消时不存在。
errorNSError?失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。

Shares a link.

分享連結。

分享一个链接。

[VGSDKFacebook shareLinkWithUrl:@"https://example.com"
    completion:^(NSDictionary<NSString *, id> *result, NSError *error) { }];

Input

輸入

输入

FieldTypeDescription
urlString?Link URL to share.
欄位型別說明
urlString?要分享的連結 URL。
字段类型描述
urlString?要分享的链接 URL。

Output

輸出

输出

FieldTypeDescription
result[String: Any]?Dialog result dictionary. Absent on error/cancel.
errorNSError?Present on failure: a VGSDK code on a guard or cancel (see Social error codes), otherwise the raw native Facebook error (share/invite dialog or re-auth failure).
欄位型別說明
result[String: Any]?對話框結果字典。發生錯誤/取消時不存在。
errorNSError?失敗時存在: 於防護或取消時為 VGSDK 代碼(請參閱 社群錯誤碼),否則為原生 Facebook 錯誤(分享/邀請對話框或重新驗證失敗)。
字段类型描述
result[String: Any]?对话框结果字典。出错 / 取消时不存在。
errorNSError?失败时存在: 在防护或取消时为 VGSDK 代码(请参阅 社交错误码),否则为原生 Facebook 错误(分享/邀请对话框或重新验证失败)。

Share to Instagram feed

Shares an image to the Instagram feed.

將圖片分享到 Instagram 動態。

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

[VGSDKInstagram shareToFeedWith:image completion:^(NSError *error) { }];

Input

輸入

输入

FieldTypeDescription
imageUIImage?Image to share.
欄位型別說明
imageUIImage?要分享的圖片。
字段类型描述
imageUIImage?要分享的图片。

Output

輸出

输出

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

Share to Instagram Stories

Shares an image to Instagram Stories.

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

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

[VGSDKInstagram shareToStoriesWith:image completion:^(NSError *error) {
    if (error == nil) { /* shared */ }
}];

Input

輸入

输入

FieldTypeDescription
imageUIImage?Image to share.
欄位型別說明
imageUIImage?要分享的圖片。
字段类型描述
imageUIImage?要分享的图片。

Output

輸出

输出

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

User Experience

Native store rating prompt and in-chat Google Translate.

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

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

Store rating (in-app review)

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

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

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

[[PassSDK shared] storeRating];

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 将文本翻译为目标语言。结果异步返回。

[[PassSDK shared] translate:@"Hello" to:@"vi" completion:^(NSString *translated) {
    // translated == @"Xin chào"
}];

Input

輸入

输入

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

Output

輸出

输出

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

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

NSString *version = [VGSDKUtilities sdkVersion];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Get current language

Returns the SDK’s active language code.

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

返回 SDK 的当前语言代码。

NSString *language = [VGSDKUtilities currentLanguage];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Get current user

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

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

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

PassUserInfo *user = [VGSDKUtilities currentUser];
if (user != nil) {
    // user.userID, user.displayName, user.type
}

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

FieldTypeDescription
userPassUserInfo?The signed-in user, or absent when no session exists. Fields: PassUserInfo.
欄位型別說明
userPassUserInfo?已登入的使用者。登出時不存在。欄位:PassUserInfo
字段类型描述
userPassUserInfo?已登录的用户,未登录时不存在。字段:PassUserInfo

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

NSString *code = [VGSDKUtilities currentCountryCode];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Get device id

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

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

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

NSString *deviceId = [VGSDKUtilities deviceId];

Input

輸入

输入

No input.

無輸入。

无输入。

Output

輸出

输出

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

Data Models

Shared objects and enums referenced by multiple methods, documented once here. For enums, each row is one case: Field = the case, Type = its raw value.

由多個方法參考的共用物件與列舉,於此處統一說明一次。對於列舉,每一列代表一個 case: Field=該 case,Type=其原始值。

被多个方法引用的共享对象与枚举,在此统一记录一次。对于枚举,每一行是一个枚举项: Field = 该枚举项,Type = 其原始值。

PassUserInfo

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

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

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

Fields

欄位

字段

FieldTypeDescription
userIDStringUnique VNGGames user id.
displayNameStringPlayer display name.
sessionIDStringSession token used to authenticate backend calls.
typePassLoginTypeLogin channel used: facebook, google, guest, apple, zing, email.
typeStringStringThe login channel as a string.
protectedStatusBoolWhether the account is protected/secured.
lastUpdateSessionIntEpoch seconds of the last session refresh.
欄位型別說明
userIDStringVNGGames 唯一使用者 ID。
displayNameString玩家顯示名稱。
sessionIDString用於驗證後端呼叫的工作階段權杖。
typePassLoginType使用的登入頻道:facebook、google、guest、apple、zing、email。
typeStringString頻道名稱字串。
protectedStatusBool帳號是否受保護/已加固。
lastUpdateSessionInt上次工作階段重新整理的 Epoch 秒數。
字段类型描述
userIDString唯一的 VNGGames 用户 id。
displayNameString玩家显示名称。
sessionIDString用于验证后端调用的会话令牌。
typePassLoginType所用的登录渠道:facebook、google、guest、apple、zing、email。
typeStringString以字符串表示的渠道名称。
protectedStatusBool账号是否受保护 / 已加固。
lastUpdateSessionInt最近一次会话刷新的 Unix 时间戳(秒)。

PassLoginType

Login channel identifier (Int enum): selects the channel for Direct login and reports which channel a player signed in with. Supported channels:

登入頻道識別碼(Int 列舉): 用於為 Direct login 選擇頻道,並回報玩家使用哪個頻道登入。支援的頻道:

登录渠道标识符(Int 枚举): 为 Direct login 选择渠道,并报告玩家使用哪个渠道登录。支持的渠道:

Fields

欄位

字段

FieldTypeDescription
.facebook1Facebook.
.google3Google.
.zing4Zing ID.
.guest5Anonymous guest.
.apple7Sign in with Apple.
.email8Email.
欄位型別說明
.facebook1Facebook。
.google3Google。
.zing4Zing ID。
.guest5匿名訪客。
.apple7使用 Apple 登入。
.email8電子郵件。
字段类型描述
.facebook1Facebook。
.google3Google。
.zing4Zing ID。
.guest5匿名访客。
.apple7Sign in with Apple。
.email8电子邮箱。

PassManageAccountAction

The action the player took on the account-management screen (Int enum).

玩家在帳號管理畫面上執行的操作(Int 列舉)。

玩家在账号管理界面上执行的操作(Int 枚举)。

Fields

欄位

字段

FieldTypeDescription
.close0Closed the screen without acting.
.deleteAccount1Chose to delete the account.
.bindAccount2Bound / linked an account.
.switchAccount3Switched to another account.
欄位型別說明
.close0未執行任何操作即關閉畫面。
.deleteAccount1選擇刪除帳號。
.bindAccount2綁定/連結了帳號。
.switchAccount3切換到另一個帳號。
字段类型描述
.close0未执行任何操作即关闭屏幕。
.deleteAccount1选择删除账号。
.bindAccount2绑定 / 关联了一个账号。
.switchAccount3切换到了另一个账号。

VGSDKPaymentProduct

A sellable product returned by Get products.

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

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

Fields

欄位

字段

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

VGSDKPaymentInfo

The purchase request passed to Purchase.

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

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

Fields

欄位

字段

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

VGSDKPaymentPurchaseStatus

Outcome of a purchase (Int enum).

購買的結果(Int 列舉)。

购买的结果(Int 枚举)。

Fields

欄位

字段

FieldTypeDescription
.success0Purchase completed.
.failed1Purchase failed. See billing / store payment error codes.
.canceled2Player canceled.
.processing3Processing / verifying with Billing System.
.pending4Awaiting external confirmation.
欄位型別說明
.success0購買完成。
.failed1購買失敗。請參閱 帳務商店 付款錯誤碼。
.canceled2玩家已取消。
.processing3由帳務系統處理/驗證中。
.pending4等待外部確認。
字段类型描述
.success0购买完成。
.failed1购买失败。请参阅 计费商店 支付错误码。
.canceled2玩家已取消。
.processing3由计费系统处理/验证中。
.pending4等待外部确认。

VGSDKSupportInfo

Player context passed to Open support center.

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

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

Fields

欄位

字段

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

VGSDKAnalyticsProvider

Analytics provider selector for sendCustomEvent (Int enum).

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

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

Fields

欄位

字段

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

Analytics default parameters

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

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

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

Fields

欄位

字段

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

Analytics platform prefixes

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

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

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

Fields

欄位

字段

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

PassFBInvitationFilter

Audience filter for Facebook invites (Int enum).

Facebook 邀請的受眾篩選(Int 列舉)。

Facebook 邀请的受众筛选(Int 枚举)。

Fields

欄位

字段

FieldTypeDescription
.allFriends0All friends.
.appUsers1Friends who already use the app.
.nonAppUsers2Friends who don’t use the app.
欄位型別說明
.allFriends0所有好友。
.appUsers1已在使用此應用程式的好友。
.nonAppUsers2未使用此應用程式的好友。
字段类型描述
.allFriends0所有好友。
.appUsers1已在使用该应用的好友。
.nonAppUsers2未使用该应用的好友。

Ad revenue mediation network

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

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

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

Fields

欄位

字段

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

Error Codes

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

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

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

Auth: VGA / OAuth (7xxx)

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

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

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

Codes

錯誤碼

错误码

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

Auth: Passport legacy (8xxx)

Passport-legacy login errors. The SDK maps each Passport server return code to an 8xxx value (8000 = unknown fallback). error.code carries the 8xxx band while the original server code is in the message. Type = the source Passport server return code.

Passport legacy 登入錯誤。SDK 會將每個 Passport 伺服器回傳碼對應到一個 8xxx 值(8000=未知備用)。error.code 帶有 8xxx 分段,而原始伺服器碼則在訊息中。Type=來源 Passport 伺服器回傳碼。

Passport 旧版登录错误。SDK 将每个 Passport 服务器返回码映射为一个 8xxx 值(8000 = 未知兜底)。error.code 携带 8xxx 段,而原始服务器码在消息中。Type = 来源 Passport 服务器返回码。

Codes

錯誤碼

错误码

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

Payment: billing server (6xxx)

Billing-server errors. The SDK maps each payment server return code to a 6xxx value (6000 = unknown fallback). Type = the source payment server code.

帳務伺服器錯誤。SDK 會將每個付款伺服器回傳碼對應到一個 6xxx 值(6000=未知備用)。Type=來源付款伺服器碼。

计费服务器错误。SDK 将每个支付服务器返回码映射为一个 6xxx 值(6000 = 未知兜底)。Type = 来源支付服务器码。

Codes

錯誤碼

错误码

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

Payment: store / verification (9xxx)

Store, receipt, and verification errors raised during the purchase flow (9xxx client-side band). iOS and Android differ: both are merged here, so the same code number can carry a different meaning on each platform. Type shows the source symbol(s) (iOS / Android).

在購買流程期間引發的商店、收據與驗證錯誤(9xxx 用戶端分段)。iOS 與 Android 有所不同: 此處合併列出,同一組代碼在不同平台上可能代表不同含義。Type 欄顯示來源符號(iOS/Android)。

在购买流程中引发的商店、收据与验证错误(9xxx 客户端段)。iOS 与 Android 有所不同: 此处合并列出,同一组代码在不同平台上可能代表不同含义。Type 列显示来源符号(iOS / Android)。

Codes

錯誤碼

错误码

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

Social (9xxx)

Facebook and Instagram profile / share / invite failures.

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

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

Codes

錯誤碼

错误码

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

In-app ads (9xxx)

ironSource and Meta Audience Network ad failures.

ironSource 與 Meta Audience Network 的廣告失敗。

ironSource 与 Meta Audience Network 的广告失败。

Codes

錯誤碼

错误码

FieldTypeDescription
9040ironSourceUnsupportedironSource not enabled in this build.
9041ironSourceMissingUserIDMissing ad user id.
9042ironSourceMissingConfigironSource config missing.
9043ironSourceConfigInvalidFormatironSource config malformed.
9044ironSourcePlacementNameNotMatchedPlacement name not found.
9045ironSourcePlacementCappedPlacement is capped.
9046ironSourceControllerToPresentNotFoundNo screen available to present the ad.
9048metaAdInvalidMeta ad is invalid / not ready.
欄位型別說明
9040ironSourceUnsupported此版本未啟用 ironSource。
9041ironSourceMissingUserID缺少廣告使用者 ID。
9042ironSourceMissingConfig缺少 ironSource 設定。
9043ironSourceConfigInvalidFormatironSource 設定格式錯誤。
9044ironSourcePlacementNameNotMatched找不到版位名稱。
9045ironSourcePlacementCapped版位已達上限。
9046ironSourceControllerToPresentNotFound沒有可用來顯示廣告的畫面。
9048metaAdInvalidMeta 廣告無效/尚未就緒。
字段类型描述
9040ironSourceUnsupported此构建版本未启用 ironSource。
9041ironSourceMissingUserID缺少广告用户 id。
9042ironSourceMissingConfig缺少 ironSource 配置。
9043ironSourceConfigInvalidFormatironSource 配置格式错误。
9044ironSourcePlacementNameNotMatched找不到广告位名称。
9045ironSourcePlacementCapped广告位已达展示上限。
9046ironSourceControllerToPresentNotFound没有可用于展示广告的屏幕。
9048metaAdInvalidMeta 广告无效 / 未就绪。

General & availability (9xxx)

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

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

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

Codes

錯誤碼

错误码

FieldTypeDescription
9000undefinedUndefined / unknown error.
9001networkFailedNetwork request failed (retryable).
9002wrongDataFormatMalformed response data.
9003cancelLoginLogin canceled (SDK band).
9005googleRefreshTokenFailedGoogle token refresh failed.
9018appleCredentialNotFoundInAuthorizationResultApple authorization returned no credential.
9019googleConfigNotFoundGoogle config missing.
9020facebookConfigNotFoundFacebook config missing.
9021appleTwoAuthenticationErrorSign in with Apple 2FA error.
9022appleCancelErrorPlayer canceled Sign in with Apple.
9023appleOtherErrorOther Sign in with Apple error.
9025appleCachedCredentialNotFoundNo cached Apple credential.
9036googleUnsupportedGoogle login not enabled in this build.
9037vgaUnsupportedVGA login not enabled in this build.
9047firebaseUnsupportedFirebase not enabled in this build.
欄位型別說明
9000undefined未定義/未知的錯誤。
9001networkFailed網路請求失敗(可重試)。
9002wrongDataFormat回應資料格式錯誤。
9003cancelLogin登入已取消(SDK 分段)。
9005googleRefreshTokenFailedGoogle 權杖重新整理失敗。
9018appleCredentialNotFoundInAuthorizationResultApple 授權未傳回任何憑證。
9019googleConfigNotFound缺少 Google 設定。
9020facebookConfigNotFound缺少 Facebook 設定。
9021appleTwoAuthenticationError使用 Apple 登入的兩階段驗證錯誤。
9022appleCancelError玩家取消了使用 Apple 登入。
9023appleOtherError其他使用 Apple 登入的錯誤。
9025appleCachedCredentialNotFound沒有快取的 Apple 憑證。
9036googleUnsupported此版本未啟用 Google 登入。
9037vgaUnsupported此版本未啟用 VGA 登入。
9047firebaseUnsupported此版本未啟用 Firebase。
字段类型描述
9000undefined未定义 / 未知错误。
9001networkFailed网络请求失败(可重试)。
9002wrongDataFormat响应数据格式错误。
9003cancelLogin登录已取消(SDK 段)。
9005googleRefreshTokenFailedGoogle 令牌刷新失败。
9018appleCredentialNotFoundInAuthorizationResultApple 授权未返回凭据。
9019googleConfigNotFound缺少 Google 配置。
9020facebookConfigNotFound缺少 Facebook 配置。
9021appleTwoAuthenticationErrorSign in with Apple 双重验证(2FA)错误。
9022appleCancelError玩家取消了 Sign in with Apple。
9023appleOtherError其他 Sign in with Apple 错误。
9025appleCachedCredentialNotFound没有缓存的 Apple 凭据。
9036googleUnsupported此构建版本未启用 Google 登录。
9037vgaUnsupported此构建版本未启用 VGA 登录。
9047firebaseUnsupported此构建版本未启用 Firebase。