UpgradeUnity

Unity Upgrade Guide

See what changed between your current SDK version and the latest, with the exact steps to migrate.

查看你目前的 SDK 版本與最新版本之間的變更,以及確切的遷移步驟。

查看你当前的 SDK 版本与最新版本之间的变更,以及确切的迁移步骤。

Pick your current and target version to see what changed.

Migration

Remove the old VNGGames SDK package

移除舊的 VNGGames SDK 套件

移除旧的 VNGGames SDK 包

  1. In the Unity Editor, open the Project window and expand Packages.
  2. Right-click the old VNGGames SDK package (com.vnggames.sdk, or com.vng.passsdk on 1.1.0) and delete it.
  3. Let Unity finish reimporting before you add the new version.
  1. 在 Unity 編輯器開啟 Project 視窗,展開 Packages。
  2. 在舊的 VNGGames SDK 套件(com.vnggames.sdk,1.1.0 為 com.vng.passsdk)上按右鍵並刪除。
  3. 待 Unity 完成重新匯入後,再加入新版本。
  1. 在 Unity 编辑器打开 Project 窗口,展开 Packages。
  2. 在旧的 VNGGames SDK 包(com.vnggames.sdk,1.1.0 为 com.vng.passsdk)上右键并删除。
  3. 待 Unity 完成重新导入后,再添加新版本。

SDK package renamed to com.vnggames.sdk

1.2.0 renames the embedded Unity package from com.vng.passsdk to com.vnggames.sdk. Importing the new package adds a second folder under Packages/ instead of replacing the old one, so the old folder has to go first.

1.2.0 將內嵌的 Unity 套件由 com.vng.passsdk 更名為 com.vnggames.sdk。匯入新套件會在 Packages/ 下新增另一個資料夾,而不會取代舊的,因此必須先移除舊資料夾。

1.2.0 将内嵌的 Unity 包由 com.vng.passsdk 更名为 com.vnggames.sdk。导入新包会在 Packages/ 下新增另一个文件夹,而不会取代旧的,因此必须先移除旧文件夹。

Packages/com.vng.passsdkPackages/com.vnggames.sdk
  1. Delete the Packages/com.vng.passsdk folder from your Unity project.
  2. Import the new package so the SDK lands at Packages/com.vnggames.sdk.
  1. 從 Unity 專案刪除 Packages/com.vng.passsdk 資料夾。
  2. 匯入新套件,使 SDK 落在 Packages/com.vnggames.sdk
  1. 从 Unity 工程删除 Packages/com.vng.passsdk 文件夹。
  2. 导入新包,使 SDK 落在 Packages/com.vnggames.sdk

Keeping the old folder leaves two copies of every SDK type under Packages/, and the Unity Editor stops compiling with duplicate-definition errors.

若保留舊資料夾,Packages/ 下會有兩份相同的 SDK 型別,Unity 編輯器將因重複定義錯誤而無法編譯。

若保留旧文件夹,Packages/ 下会有两份相同的 SDK 类型,Unity 编辑器将因重复定义错误而无法编译。

MediationNetwork enum cases renamed

The mediation networks you pass to PassSDK.Instance.AppsFlyerAdRevenue were re-cased, and customMediation became Custom. The method signature itself is unchanged, so only the case names have to move.

傳入 PassSDK.Instance.AppsFlyerAdRevenue 的中介聯播網列舉值調整了大小寫,customMediation 也改為 Custom。方法簽名本身未變,因此只需更新列舉值名稱。

传入 PassSDK.Instance.AppsFlyerAdRevenue 的聚合网络枚举值调整了大小写,customMediation 也改为 Custom。方法签名本身未变,因此只需更新枚举值名称。

↪ Also changed in 1.6.0, see: New unified VGSDKAnalytics event API

↪ 於 1.6.0 亦有變更,請參見: 全新統一的 VGSDKAnalytics 事件 API

↪ 于 1.6.0 亦有变更,请参见: 全新统一的 VGSDKAnalytics 事件 API

MediationNetwork.IronsourceMediationNetwork.IronSource
MediationNetwork.ApplovinmaxMediationNetwork.ApplovinMax
MediationNetwork.GoogleadmobMediationNetwork.GoogleAdMob
MediationNetwork.ChartboostMediationNetwork.ChartBoost
MediationNetwork.customMediationMediationNetwork.Custom

Switch each call to the replacement shown in the table above.

將每個呼叫改為上表所示的替代項目。

将每个调用改为上表所示的替代项。

The old API no longer exists, so your project stops compiling until you migrate.

舊 API 已不存在,未完成遷移前你的專案將無法編譯。

旧 API 已不存在,未完成迁移前你的工程将无法编译。

PassUserInfo.LoginTypeString renamed to LoginChannelString

The user model’s login-type string now follows the LoginChannel naming the rest of the SDK already used. The value it carries is unchanged.

使用者模型的登入類型字串改為沿用 SDK 其他地方既有的 LoginChannel 命名,欄位所帶的值並未改變。

用户模型的登录类型字符串改为沿用 SDK 其他地方既有的 LoginChannel 命名,字段所带的值并未改变。

PassUserInfo.LoginTypeStringPassUserInfo.LoginChannelString

Switch each call to the replacement shown in the table above.

將每個呼叫改為上表所示的替代項目。

将每个调用改为上表所示的替代项。

The old API no longer exists, so your project stops compiling until you migrate.

舊 API 已不存在,未完成遷移前你的專案將無法編譯。

旧 API 已不存在,未完成迁移前你的工程将无法编译。

DataPlatformCustomEvent now takes the event name as its first argument

The Data Platform event name is now a separate, required parameter instead of being carried inside the data dictionary, matching the other per-provider custom-event calls.

Data Platform 事件名稱現在是獨立的必填參數,不再放在資料字典中,與其他平台專屬的自訂事件呼叫一致。

Data Platform 事件名称现在是独立的必填参数,不再放在数据字典中,与其他提供商专属的自定义事件调用一致。

PassSDK.Instance.DataPlatformCustomEvent(parameter)PassSDK.Instance.DataPlatformCustomEvent(eventName, parameter)

Pass the event name as the new first argument of every PassSDK.Instance.DataPlatformCustomEvent call.

在每個 PassSDK.Instance.DataPlatformCustomEvent 呼叫中,將事件名稱作為新的第一個參數傳入。

在每个 PassSDK.Instance.DataPlatformCustomEvent 调用中,将事件名称作为新的第一个参数传入。

The old API no longer exists, so your project stops compiling until you migrate.

舊 API 已不存在,未完成遷移前你的專案將無法編譯。

旧 API 已不存在,未完成迁移前你的工程将无法编译。

New CleverTap in-app notification button callback

1.3.0 adds CleverTap in-app messaging. The custom extras of the button a player taps reach the game only through the callback you register, so registering it is what makes an in-app message actionable in-game.

1.3.0 新增 CleverTap 應用內訊息。玩家點擊按鈕所帶的 custom extras 只會透過你註冊的回呼傳給遊戲,因此註冊回呼才能讓應用內訊息在遊戲中產生後續動作。

1.3.0 新增 CleverTap 应用内消息。玩家点击按钮所带的 custom extras 只会通过你注册的回调传给游戏,因此注册回调才能让应用内消息在游戏中产生后续动作。

PassSDK.Instance.OnCleverTapInAppButtonClick(action)

Register a callback with PassSDK.Instance.OnCleverTapInAppButtonClick and route the custom extras it delivers.

PassSDK.Instance.OnCleverTapInAppButtonClick 註冊回呼,並依其傳回的 custom extras 在遊戲內導頁。

PassSDK.Instance.OnCleverTapInAppButtonClick 注册回调,并依其返回的 custom extras 在游戏内跳转。

See the usage and full signature in the Integration guide:

Set CleverTap listener

請在整合指南中查看用法與完整簽名:

設定 CleverTap 監聽器

请在集成指南中查看用法与完整签名:

设置 CleverTap 监听器

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

New PassSDK.Instance.QuickLogin for VGA Quick Login

1.5.0 adds a dedicated Quick Login entry point, separate from the standard ShowFormLogin flow. It signs a returning VGA player in with no interaction.

1.5.0 新增獨立於標準 ShowFormLogin 流程的專用快速登入進入點,讓回訪的 VGA 玩家零互動完成登入。

1.5.0 新增独立于标准 ShowFormLogin 流程的专用快速登录入口,让回访的 VGA 玩家零交互完成登录。

PassSDK.Instance.QuickLogin(action)
  1. Call PassSDK.Instance.QuickLogin to start the VGA Quick Login flow.
  2. Read the signed-in PassUserInfo or the error from its result callback.
  1. 呼叫 PassSDK.Instance.QuickLogin 以啟動 VGA 快速登入流程。
  2. 從其結果回呼取得登入後的 PassUserInfo 或錯誤。
  1. 调用 PassSDK.Instance.QuickLogin 以启动 VGA 快速登录流程。
  2. 从其结果回调取得登录后的 PassUserInfo 或错误。

See the usage and full signature in the Integration guide:

Quick login

請在整合指南中查看用法與完整簽名:

快速登入

请在集成指南中查看用法与完整签名:

快速登录

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

New PassSDK.Instance.ManageAccount with the VGSDKManageAccount result

1.5.0 adds VGA account management (bind, switch, delete, close), surfaced through the new VGSDKManageAccount result and its VGSDKManageAccountAction enum.

1.5.0 新增 VGA 帳號管理(綁定、切換、刪除、關閉),透過新的 VGSDKManageAccount 結果與其 VGSDKManageAccountAction 列舉提供。

1.5.0 新增 VGA 账号管理(绑定、切换、删除、关闭),通过新的 VGSDKManageAccount 结果与其 VGSDKManageAccountAction 枚举提供。

PassSDK.Instance.ManageAccount(action)
VGSDKManageAccount
VGSDKManageAccountAction
  1. Call PassSDK.Instance.ManageAccount to present VGA account management.
  2. Branch on the returned VGSDKManageAccountAction and refresh your session from the updated PassUserInfo.
  1. 呼叫 PassSDK.Instance.ManageAccount 以顯示 VGA 帳號管理介面。
  2. 依回傳的 VGSDKManageAccountAction 分支處理,並以更新後的 PassUserInfo 刷新你的工作階段。
  1. 调用 PassSDK.Instance.ManageAccount 以显示 VGA 账号管理界面。
  2. 根据返回的 VGSDKManageAccountAction 分支处理,并以更新后的 PassUserInfo 刷新你的会话。

See the usage and full signature in the Integration guide:

Open account managementVGSDKManageAccountAction

請在整合指南中查看用法與完整簽名:

開啟帳號管理VGSDKManageAccountAction

请在集成指南中查看用法与完整签名:

打开账号管理VGSDKManageAccountAction

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

Payment API replaced by VGSDKPayment

The four payment methods left PassSDK for the static VGSDKPayment facade, and the product model was re-typed. Products now arrive as VGSDKPaymentProduct, whose Price is a number and which also carries DisplayPrice and PriceMicros, instead of the string-only PassProductInfo.

四個付款方法已從 PassSDK 移至靜態的 VGSDKPayment 門面,商品模型也重新定型。商品現在以 VGSDKPaymentProduct 回傳,其 Price 為數值,並額外提供 DisplayPrice 與 PriceMicros,取代僅有字串欄位的 PassProductInfo。

四个支付方法已从 PassSDK 移至静态的 VGSDKPayment 门面,商品模型也重新定型。商品现在以 VGSDKPaymentProduct 返回,其 Price 为数值,并额外提供 DisplayPrice 与 PriceMicros,取代仅有字符串字段的 PassProductInfo。

PassSDK.Instance.GetProductList(list, action)VGSDKPayment.GetProducts(ids, action)
PassSDK.Instance.Purchase(info, action)VGSDKPayment.Purchase(info, action)
PassSDK.Instance.CheckReward(action)VGSDKPayment.CheckReward(action)
PassSDK.Instance.VerifyReward(info, action)VGSDKPayment.VerifyReward(info, action)
PassProductResultVGSDKPaymentProducts
PassProductInfoVGSDKPaymentProduct
PassProductResult.listVGSDKPaymentProducts.Products
  1. Move every payment call from PassSDK.Instance to the static VGSDKPayment facade.
  2. Pass a string array of product ids to VGSDKPayment.GetProducts in place of the old list.
  3. Read products from VGSDKPaymentProducts.Products as VGSDKPaymentProduct, taking Price as a number rather than a string.
  1. 將每個付款呼叫從 PassSDK.Instance 改為靜態的 VGSDKPayment 門面。
  2. 改以商品 id 的字串陣列傳入 VGSDKPayment.GetProducts,取代原本的清單。
  3. 從 VGSDKPaymentProducts.Products 以 VGSDKPaymentProduct 讀取商品,並將 Price 視為數值而非字串。
  1. 将每个支付调用从 PassSDK.Instance 改为静态的 VGSDKPayment 门面。
  2. 改以商品 id 的字符串数组传入 VGSDKPayment.GetProducts,取代原本的列表。
  3. 从 VGSDKPaymentProducts.Products 以 VGSDKPaymentProduct 读取商品,并将 Price 视为数值而非字符串。

The old API no longer exists, so your project stops compiling until you migrate.

舊 API 已不存在,未完成遷移前你的專案將無法編譯。

旧 API 已不存在,未完成迁移前你的工程将无法编译。

New unified VGSDKAnalytics event API

1.6.0 adds VGSDKAnalytics, a typed game-event facade: one call reports a game event to every analytics provider your game has configured, instead of wiring the same event up per provider. It covers the conversion-rate, role-config and ad-revenue calls listed below, which keep working but are no longer the way to report those events.

1.6.0 新增 VGSDKAnalytics,一個型別化的遊戲事件門面:單一呼叫即可將遊戲事件回報給遊戲已設定的所有分析平台,不必再為每個平台分別接上同一個事件。它涵蓋下表所列的轉換率、角色設定與廣告收益呼叫。這些舊呼叫仍可運作,但已不再是回報這些事件的方式。

1.6.0 新增 VGSDKAnalytics,一个类型化的游戏事件门面:单一调用即可将游戏事件上报给游戏已配置的所有分析提供商,不必再为每个提供商分别接上同一个事件。它涵盖下表所列的转化率、角色配置与广告收入调用。这些旧调用仍可使用,但已不再是上报这些事件的方式。

VGSDKAnalytics
PassSDK.Instance.CDNDownloadStartVGSDKAnalytics.RegCDNDownloadStart
PassSDK.Instance.CDNDownloadCompleteVGSDKAnalytics.RegCDNDownloadFinish
PassSDK.Instance.CDNExtractResourceStartVGSDKAnalytics.RegExtractResourceStart
PassSDK.Instance.CDNExtractResourceCompleteVGSDKAnalytics.RegExtractResourceEnd
PassSDK.Instance.ThinkingDataSetRoleVGSDKAnalytics.MiscConfigAnalytics
PassSDK.Instance.AppsFlyerAdRevenueVGSDKAnalytics.MiscAdRevenue
MediationNetworkVGSDKAdRevenueMediationNetwork

Switch each call to the replacement shown in the table above.

將每個呼叫改為上表所示的替代項目。

将每个调用改为上表所示的替代项。

Nothing breaks and your existing PassSDK.Instance analytics calls keep working, but you keep a separate call site per provider and your game events never reach the other providers VGSDKAnalytics fans them out to.

不會有任何中斷,你現有的 PassSDK.Instance 分析呼叫仍可運作,但你仍須為每個平台維護獨立的呼叫點,且遊戲事件不會送達 VGSDKAnalytics 會一併分發的其他平台。

不会有任何中断,你现有的 PassSDK.Instance 分析调用仍可使用,但你仍须为每个提供商维护独立的调用点,且游戏事件不会送达 VGSDKAnalytics 会一并分发的其他提供商。

Meta Ads (Meta Audience Network) in-app advertising

1.7.0 adds VGSDKMetaAds alongside IronSource, so a game can run its in-app advertising on either network. It covers interstitial, rewarded-video, and rewarded-interstitial formats, each reporting progress through its own status enum.

1.7.0 在 IronSource 之外新增 VGSDKMetaAds,讓遊戲可選擇任一聯播網投放應用內廣告。支援插頁廣告、獎勵影片與獎勵插頁廣告,各自透過專屬的狀態列舉回報進度。

1.7.0 在 IronSource 之外新增 VGSDKMetaAds,让游戏可选择任一网络投放应用内广告。支持插页广告、激励视频与激励插页广告,各自通过专属的状态枚举回报进度。

VGSDKMetaAds
VGSDKMetaAds.ShowInterstitial
VGSDKMetaAds.ShowRewardedVideo
VGSDKMetaAds.ShowRewardedInterstitial
VGSDKMetaAdsInterstitialStatus
VGSDKMetaAdsRewardedVideoStatus
VGSDKMetaAdsRewardedInterstitialStatus
  1. Show each ad format through the matching VGSDKMetaAds call.
  2. Branch on the Status of the listener each call returns to grant or withhold the reward.
  1. 透過對應的 VGSDKMetaAds 方法顯示各種廣告格式。
  2. 依各呼叫回傳監聽器的 Status 分支處理,決定是否發放獎勵。
  1. 通过对应的 VGSDKMetaAds 方法展示各种广告格式。
  2. 根据各调用返回监听器的 Status 分支处理,决定是否发放奖励。

See the usage and full signature in the Integration guide:

Show interstitialShow rewarded videoShow rewarded interstitial

請在整合指南中查看用法與完整簽名:

顯示插頁式廣告顯示獎勵影片顯示獎勵式插頁廣告

请在集成指南中查看用法与完整签名:

展示插屏广告展示激励视频展示激励插屏广告

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

One custom-event API for every analytics provider

1.8.0 adds VGSDKAnalytics.SendCustomEvent, which takes the providers as data (a VGSDKAnalyticsPlatform per VGSDKAnalyticsProvider you target) rather than making you pick a different method name per provider, and delivers one call to every provider you list. Each platform also carries its own prefix, so you decide the event-name prefix instead of inheriting a default.

1.8.0 新增 VGSDKAnalytics.SendCustomEvent,改以資料形式指定平台(為每個目標 VGSDKAnalyticsProvider 各建立一個 VGSDKAnalyticsPlatform),不必再依平台選用不同的方法名稱,單一呼叫即可送達你列出的所有平台。每個 platform 也自帶 prefix,因此事件名稱前綴由你決定,而非沿用預設值。

1.8.0 新增 VGSDKAnalytics.SendCustomEvent,改以数据形式指定提供商(为每个目标 VGSDKAnalyticsProvider 各构建一个 VGSDKAnalyticsPlatform),不必再按提供商选用不同的方法名,单一调用即可送达你列出的所有提供商。每个 platform 也自带 prefix,因此事件名称前缀由你决定,而非沿用默认值。

VGSDKAnalytics.SendCustomEvent
PassSDK.Instance.DataPlatformCustomEventVGSDKAnalytics.SendCustomEvent
PassSDK.Instance.CleverTapCustomEventVGSDKAnalytics.SendCustomEvent
PassSDK.Instance.ThinkingDataCustomEventVGSDKAnalytics.SendCustomEvent
PassSDK.Instance.AppsFlyerCustomEventVGSDKAnalytics.SendCustomEvent
PassSDK.Instance.FirebaseCustomEventVGSDKAnalytics.SendCustomEvent
PassSDK.Instance.FacebookCustomEventVGSDKAnalytics.SendCustomEvent

Switch each call to the replacement shown in the table above.

將每個呼叫改為上表所示的替代項目。

将每个调用改为上表所示的替代项。

See the usage and full signature in the Integration guide:

Send a custom event

請在整合指南中查看用法與完整簽名:

傳送自訂事件

请在集成指南中查看用法与完整签名:

发送自定义事件

Nothing breaks and your existing per-provider custom-event calls keep working, but you keep a separate call site for every provider and you cannot choose the prefix your event names are sent with.

不會有任何中斷,你現有的各平台自訂事件呼叫仍可運作,但你仍須為每個平台維護獨立的呼叫點,且無法自行決定事件名稱送出時所帶的 prefix。

不会有任何中断,你现有的各提供商自定义事件调用仍可使用,但你仍须为每个提供商维护独立的调用点,且无法自行决定事件名称发送时所带的 prefix。

Minimum iOS version raised to 13.0

The minimum supported iOS version is now 13.0 (was 12.0), and the SDK stamps that floor onto the iOS project it exports. The public C# API is unchanged in this release.

最低支援的 iOS 版本現為 13.0(原為 12.0),SDK 也會將此下限寫入其匯出的 iOS 專案。本次發佈的公開 C# API 並未變更。

最低支持的 iOS 版本现为 13.0(原为 12.0),SDK 也会将此下限写入其导出的 iOS 工程。本次发布的公开 C# API 并未变更。

Set Target minimum iOS Version to 13.0 or later in Unity Player Settings before you export the iOS project.

在匯出 iOS 專案前,於 Unity Player Settings 將 Target minimum iOS Version 設為 13.0 或以上。

在导出 iOS 工程前,于 Unity Player Settings 将 Target minimum iOS Version 设为 13.0 或以上。

An exported project still targeting iOS 12 mixes a 12.0 app target with 13.0 SDK dependencies and fails to build, and iOS 12 devices are no longer supported.

仍以 iOS 12 為目標的匯出專案,會讓 12.0 的 App target 與 13.0 的 SDK 相依套件並存而無法建置,且不再支援 iOS 12 裝置。

仍以 iOS 12 为目标的导出工程,会让 12.0 的 App target 与 13.0 的 SDK 依赖并存而无法构建,且不再支持 iOS 12 设备。

New Quick Auth API: VGSDKQuickAuth

1.10.0 adds a dedicated Quick Auth facade that splits the entry point into three flows, so a returning player can jump straight in, play as a guest, or pick a login channel first. It replaces nothing. PassSDK.Instance.QuickLogin is unchanged and both generations stay available.

1.10.0 新增專用的 Quick Auth 門面,將進入點拆為三種流程,讓回訪玩家可直接進入遊戲、以訪客身分遊玩,或先選擇登入管道。它不取代任何既有 API:PassSDK.Instance.QuickLogin 未變更,兩代 API 皆持續可用。

1.10.0 新增专用的 Quick Auth 门面,将入口拆为三种流程,让回访玩家可直接进入游戏、以访客身份游玩,或先选择登录渠道。它不取代任何既有 API:PassSDK.Instance.QuickLogin 未变更,两代 API 均持续可用。

VGSDKQuickAuth
VGSDKQuickAuth.ShowLogin
VGSDKQuickAuth.PlayAsGuest
VGSDKQuickAuth.ShowChannelSelection
  1. Start each Quick Auth flow through the matching VGSDKQuickAuth call.
  2. Read the signed-in PassUserInfo or the error from its result callback.
  1. 透過對應的 VGSDKQuickAuth 方法啟動各項 Quick Auth 流程。
  2. 從其結果回呼取得登入後的 PassUserInfo 或錯誤。
  1. 通过对应的 VGSDKQuickAuth 方法启动各项 Quick Auth 流程。
  2. 从其结果回调取得登录后的 PassUserInfo 或错误。

See the usage and full signature in the Integration guide:

Sign inPlay as guestShow channel selection

請在整合指南中查看用法與完整簽名:

登入以訪客身分遊玩顯示頻道選擇

请在集成指南中查看用法与完整签名:

登录以访客身份游玩显示渠道选择

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

New App Inbox module (VGSDKAppInbox, CleverTap-backed)

1.11.0 adds an in-app message inbox the game opens on demand, with a styleable UI (VGSDKAppInboxCleverTapStyle covers the title, the tab items, and the colors). Messages a player missed stay reachable there.

1.11.0 新增可由遊戲隨時開啟的應用內訊息收件匣,介面樣式可自訂(VGSDKAppInboxCleverTapStyle 涵蓋標題、分頁項目與顏色),玩家錯過的訊息仍可在此取得。

1.11.0 新增可由游戏随时打开的应用内消息收件箱,界面样式可自定义(VGSDKAppInboxCleverTapStyle 涵盖标题、标签项与颜色),玩家错过的消息仍可在此取得。

VGSDKAppInbox
VGSDKAppInbox.Open
VGSDKAppInboxCleverTapProvider
VGSDKAppInboxCleverTapStyle
VGSDKAppInboxListener
  1. Open the inbox with VGSDKAppInbox.Open, passing a styled VGSDKAppInboxCleverTapProvider.
  2. Handle the tapped item on the VGSDKAppInboxListener the call returns.
  1. VGSDKAppInbox.Open 開啟收件匣,並傳入已設定樣式的 VGSDKAppInboxCleverTapProvider。
  2. 於呼叫回傳的 VGSDKAppInboxListener 處理被點擊的項目。
  1. VGSDKAppInbox.Open 打开收件箱,并传入已设置样式的 VGSDKAppInboxCleverTapProvider。
  2. 在调用返回的 VGSDKAppInboxListener 上处理被点击的项目。

See the usage and full signature in the Integration guide:

Open the app inbox

請在整合指南中查看用法與完整簽名:

開啟應用程式收件匣

请在集成指南中查看用法与完整签名:

打开应用收件箱

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

AIHelp customer-support methods removed

1.12.0 drops AIHelp from the SDK. Both public entry points were deleted from PassSDK, so any call site that still references them no longer resolves.

1.12.0 自 SDK 移除 AIHelp,兩個公開進入點已從 PassSDK 刪除,任何仍引用它們的呼叫點都將無法解析。

1.12.0 自 SDK 移除 AIHelp,两个公开入口已从 PassSDK 删除,任何仍引用它们的调用点都将无法解析。

PassSDK.Instance.AIHelpShowWithConfig(entranceId, message)
PassSDK.Instance.AIHelpSetUser(info)
  1. Remove every PassSDK.Instance.AIHelpShowWithConfig call from your game.
  2. Remove every PassSDK.Instance.AIHelpSetUser call from your game.
  1. 從遊戲中移除所有 PassSDK.Instance.AIHelpShowWithConfig 呼叫。
  2. 從遊戲中移除所有 PassSDK.Instance.AIHelpSetUser 呼叫。
  1. 从游戏中移除所有 PassSDK.Instance.AIHelpShowWithConfig 调用。
  2. 从游戏中移除所有 PassSDK.Instance.AIHelpSetUser 调用。

The old API no longer exists, so your project stops compiling until you migrate.

舊 API 已不存在,未完成遷移前你的專案將無法編譯。

旧 API 已不存在,未完成迁移前你的工程将无法编译。

New VGSDK.SetGameContext for role and server context

1.12.0 adds the VGSDK facade with SetGameContext and the VGSDKGameContext model. Engagement campaigns target players by role and server, so the SDK only knows which player it is talking to once the game hands it that context.

1.12.0 新增 VGSDK 門面的 SetGameContext 與 VGSDKGameContext 模型。互動經營活動以角色與伺服器鎖定玩家,因此只有在遊戲提供此情境後,SDK 才知道目前對象是哪位玩家。

1.12.0 新增 VGSDK 门面的 SetGameContext 与 VGSDKGameContext 模型。互动运营活动以角色与服务器锁定玩家,因此只有在游戏提供该上下文后,SDK 才知道当前对象是哪位玩家。

VGSDK
VGSDK.SetGameContext
VGSDKGameContext

Call VGSDK.SetGameContext with a VGSDKGameContext once the player has picked a role and a server.

在玩家選好角色與伺服器後,以 VGSDKGameContext 呼叫 VGSDK.SetGameContext

在玩家选好角色与服务器后,以 VGSDKGameContext 调用 VGSDK.SetGameContext

See the usage and full signature in the Integration guide:

Set the game context

請在整合指南中查看用法與完整簽名:

設定遊戲情境

请在集成指南中查看用法与完整签名:

设置游戏上下文

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

New VGSDKSupport.OpenSupportCenter with a typed listener

1.15.0 adds VGSDKSupport, whose callback returns a VGSDKSupportCenterListener carrying a Type and a Data payload instead of the plain string PassSDK.Instance.ShowCustomerSupport returns. That lets the game tell an in-portal action apart from a dismissal, and act on the payload.

1.15.0 新增 VGSDKSupport,其回呼回傳帶有 Type 與 Data 內容的 VGSDKSupportCenterListener,取代 PassSDK.Instance.ShowCustomerSupport 回傳的純字串,讓遊戲能區分 Portal 內的動作與關閉行為,並依內容處理。

1.15.0 新增 VGSDKSupport,其回调返回带有 Type 与 Data 内容的 VGSDKSupportCenterListener,取代 PassSDK.Instance.ShowCustomerSupport 返回的纯字符串,让游戏能区分 Portal 内的动作与关闭行为,并依内容处理。

VGSDKSupport.OpenSupportCenter(info, action)
PassSDK.Instance.ShowCustomerSupport(info, action)VGSDKSupport.OpenSupportCenter(info, action)
  1. Move every PassSDK.Instance.ShowCustomerSupport call to VGSDKSupport.OpenSupportCenter.
  2. Branch on the listener’s Type and read its Data payload instead of parsing the old string result.
  1. 將每個 PassSDK.Instance.ShowCustomerSupport 呼叫改為 VGSDKSupport.OpenSupportCenter
  2. 依監聽器的 Type 分支處理並讀取其 Data 內容,取代解析舊有的字串結果。
  1. 将每个 PassSDK.Instance.ShowCustomerSupport 调用改为 VGSDKSupport.OpenSupportCenter
  2. 根据监听器的 Type 分支处理并读取其 Data 内容,取代解析旧有的字符串结果。

See the usage and full signature in the Integration guide:

Open support center

請在整合指南中查看用法與完整簽名:

開啟支援中心

请在集成指南中查看用法与完整签名:

打开客户支持中心

Nothing breaks and PassSDK.Instance.ShowCustomerSupport keeps working, but its callback still returns a plain string, so the game cannot tell an in-portal action from a dismissal and never receives the action’s payload.

不會有任何損壞,PassSDK.Instance.ShowCustomerSupport 仍可運作,但其回呼仍只回傳純字串,因此遊戲無法區分 Portal 內的動作與關閉行為,也收不到該動作的內容。

不会有任何损坏,PassSDK.Instance.ShowCustomerSupport 仍可使用,但其回调仍只返回纯字符串,因此游戏无法区分 Portal 内的动作与关闭行为,也收不到该动作的内容。

Custom push-notification sounds via a build-time asset drop

1.17.0 lets a game ship its own notification sound. There is no API to call: the build post-processor picks up whatever you place in the package’s notification sound folder and wires it into both the iOS and the Android export.

1.17.0 讓遊戲可提供自訂的通知音效。無需呼叫任何 API:建置後處理器會取用你放在套件通知音效資料夾中的檔案,並自動接入 iOS 與 Android 的匯出結果。

1.17.0 让游戏可提供自定义的通知声音。无需调用任何 API:构建后处理器会取用你放在包通知声音文件夹中的文件,并自动接入 iOS 与 Android 的导出结果。

  1. Copy your sound file into Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/.
  2. Export the native project as usual, with no script changes.
  3. Reference the sound in your push payload by resource name on Android and by full filename on iOS.
  1. 將音效檔案複製到 Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/
  2. 照常匯出原生專案,無需修改任何指令碼。
  3. 在推播負載中引用該音效,Android 使用資源名稱,iOS 使用完整檔名。
  1. 将声音文件复制到 Packages/com.vnggames.sdk/Editor/ProcessBuild/Resources/Notification/sound/
  2. 照常导出原生工程,无需修改任何脚本。
  3. 在推送负载中引用该声音,Android 使用资源名,iOS 使用完整文件名。

See the usage and full signature in the Integration guide:

Add a custom sound

請在整合指南中查看用法與完整簽名:

新增自訂音效

请在集成指南中查看用法与完整签名:

添加自定义声音

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

1.17.0 adds the deep-link listener the integrator must register to receive deep links from native in-app messages. Without it, a deep link carried by an in-app message is not delivered to the game.

1.17.0 新增了整合方必須註冊的 deep-link 監聽器,用以接收原生應用內訊息的 deep link。若未註冊,應用內訊息所攜帶的 deep link 不會傳遞給遊戲。

1.17.0 新增了接入方必须注册的 deep-link 监听器,用以接收原生应用内消息的 deep link。若未注册,应用内消息所携带的 deep link 不会传递给游戏。

VGSDKAppInbox.SetInAppMessageDeepLinkListener
  1. Register a listener with VGSDKAppInbox.SetInAppMessageDeepLinkListener.
  2. Route the deep-link string it delivers to the matching screen in your game.
  1. 於啟動階段以 VGSDKAppInbox.SetInAppMessageDeepLinkListener 註冊監聽器。
  2. 將它傳回的 deep link 字串導向遊戲中對應的畫面。
  1. 在启动阶段以 VGSDKAppInbox.SetInAppMessageDeepLinkListener 注册监听器。
  2. 将它返回的 deep link 字符串导向游戏中对应的界面。

See the usage and full signature in the Integration guide:

Set in-app-message deep-link listener

請在整合指南中查看用法與完整簽名:

設定應用程式內訊息深層連結監聽器

请在集成指南中查看用法与完整签名:

设置应用内消息深链监听器

This addition is opt-in. Nothing breaks if you skip it: your existing integration keeps working, you just don’t gain this capability.

此新增功能為選用。略過不會造成任何問題:你現有的整合仍可正常運作,只是不會獲得此功能。

此新增功能为可选。跳过不会造成任何问题:你现有的集成仍可正常运行,只是不会获得此功能。

Android compile and target API level raised to 36

The SDK stamps the compile and target API level onto the Android project it exports, and that floor is now 36 (was 35). The public C# API is unchanged in this release.

SDK 會將 compile 與 target API level 寫入其匯出的 Android 專案,該下限現為 36(原為 35)。本次發佈的公開 C# API 並未變更。

SDK 会将 compile 与 target API level 写入其导出的 Android 工程,该下限现为 36(原为 35)。本次发布的公开 C# API 并未变更。

  1. Install Android SDK Platform 36 in the Android SDK your Unity build uses.
  2. Re-test your Android build, because the exported launcher module now compiles and targets API 36.
  1. 在 Unity 建置所使用的 Android SDK 中安裝 Android SDK Platform 36。
  2. 重新測試 Android 建置,因為匯出的 launcher 模組現在會以 API 36 進行 compile 與 target。
  1. 在 Unity 构建所使用的 Android SDK 中安装 Android SDK Platform 36。
  2. 重新测试 Android 构建,因为导出的 launcher 模块现在会以 API 36 进行 compile 与 target。

A build machine without Android SDK Platform 36 stops in Gradle when it cannot find that compile SDK, and once it builds, your app declares target API 36 to the Play Store.

未安裝 Android SDK Platform 36 的建置機器會在 Gradle 找不到該 compile SDK 時中斷,而建置成功後,你的 App 會向 Play Store 宣告 target API 36。

未安装 Android SDK Platform 36 的构建机器会在 Gradle 找不到该 compile SDK 时中断,而构建成功后,你的 App 会向 Play Store 声明 target API 36。

Failure callbacks now always arrive, including on stripped builds

On builds with managed code stripping enabled, every failure callback used to be dropped before it reached your handler, so a failed call simply never came back. Failures now always arrive, and a native payload that cannot be parsed comes through as an Error with Code -1 and StringCode sdk_malformed_error.

在啟用 managed code stripping 的建置中,所有失敗回呼都會在抵達你的處理程式前被丟棄,因此失敗的呼叫根本不會回來。現在失敗一定會送達,且無法解析的原生內容會以 Code 為 -1、StringCode 為 sdk_malformed_error 的 Error 回傳。

在启用 managed code stripping 的构建中,所有失败回调都会在抵达你的处理程序前被丢弃,因此失败的调用根本不会回来。现在失败一定会送达,且无法解析的原生内容会以 Code 为 -1、StringCode 为 sdk_malformed_error 的 Error 返回。

Error
  1. Implement the error branch of every SDK call, because failures that were silently dropped now reach your callback.
  2. Treat an Error with Code -1 and StringCode sdk_malformed_error as an unexpected SDK failure, and read Error.Message for the raw payload.
  3. Re-test your failure paths on an IL2CPP build with managed stripping enabled.
  1. 為每個 SDK 呼叫實作錯誤分支,因為原本被靜默丟棄的失敗現在會送達你的回呼。
  2. 將 Code 為 -1、StringCode 為 sdk_malformed_error 的 Error 視為非預期的 SDK 失敗,並從 Error.Message 讀取原始內容。
  3. 在啟用 managed stripping 的 IL2CPP 建置上重新測試失敗路徑。
  1. 为每个 SDK 调用实现错误分支,因为原本被静默丢弃的失败现在会送达你的回调。
  2. 将 Code 为 -1、StringCode 为 sdk_malformed_error 的 Error 视为非预期的 SDK 失败,并从 Error.Message 读取原始内容。
  3. 在启用 managed stripping 的 IL2CPP 构建上重新测试失败路径。

If your callbacks only implement the success branch, the failures that now surface (previously the call never came back at all) are ignored, so a failed call produces no reaction in your game.

若你的回呼只實作成功分支,現在會浮現的失敗(先前呼叫根本不會回來)將被忽略,導致呼叫失敗時你的遊戲毫無反應。

若你的回调只实现成功分支,现在会浮现的失败(此前调用根本不会回来)将被忽略,导致调用失败时你的游戏毫无反应。

Show and hide the App Inbox floating button from your game

1.19.0 hands the App Inbox floating button over to the game, so it can be taken off a cutscene or a full-screen shop and put back in the lobby. The first call in either direction takes control for the rest of the session, and the SDK stops showing or hiding the button on its own.

1.19.0 將 App Inbox 浮動按鈕交由遊戲控制,可在過場動畫或全螢幕商店中移除,並在大廳重新顯示。任一方向的第一次呼叫即會取得本次工作階段的控制權,SDK 不再自行顯示或隱藏該按鈕。

1.19.0 将 App Inbox 浮动按钮交由游戏控制,可在过场动画或全屏商店中移除,并在大厅重新显示。任一方向的第一次调用即会取得本次会话的控制权,SDK 不再自行显示或隐藏该按钮。

VGSDKAppInbox.ShowFloatingButton
VGSDKAppInbox.HideFloatingButton
  1. Call VGSDKAppInbox.HideFloatingButton when your game enters a scene the button must stay off.
  2. Call VGSDKAppInbox.ShowFloatingButton when the player reaches a scene where it may appear again.
  3. Re-issue the call your scene needs after a logout, because the next session starts with the SDK deciding again.
  4. Read the Unity console for the outcome of each call, because neither method returns a value.
  1. 在遊戲進入不應顯示按鈕的場景時呼叫 VGSDKAppInbox.HideFloatingButton
  2. 在玩家回到允許顯示按鈕的場景時呼叫 VGSDKAppInbox.ShowFloatingButton
  3. 登出後重新發出該場景所需的呼叫,因為下一個工作階段會交回 SDK 決定。
  4. 從 Unity console 確認每次呼叫的結果,因為兩個方法都不會回傳值。
  1. 在游戏进入不应显示按钮的场景时调用 VGSDKAppInbox.HideFloatingButton
  2. 在玩家回到允许显示按钮的场景时调用 VGSDKAppInbox.ShowFloatingButton
  3. 登出后重新发出该场景所需的调用,因为下一个会话会交回 SDK 决定。
  4. 从 Unity console 确认每次调用的结果,因为两个方法都不会返回值。

See the usage and full signature in the Integration guide:

Show the app inbox floating buttonHide the app inbox floating button

請在整合指南中查看用法與完整簽名:

顯示收件匣浮動按鈕隱藏收件匣浮動按鈕

请在集成指南中查看用法与完整签名:

显示收件箱悬浮按钮隐藏收件箱悬浮按钮

Nothing breaks and the App Inbox keeps working, but the SDK alone decides when the floating button is on screen, so it can sit over a cutscene or a full-screen shop with no way for your game to move it out of the way.

不會有任何中斷,App Inbox 仍照常運作,但浮動按鈕何時出現完全由 SDK 決定,因此它可能疊在過場動畫或全螢幕商店上,而遊戲無法將它移開。

不会有任何中断,App Inbox 仍照常运作,但浮动按钮何时出现完全由 SDK 决定,因此它可能叠在过场动画或全屏商店上,而游戏无法将它移开。

Hiding the App Inbox button now also holds back in-app messages

The same two App Inbox visibility calls now also decide whether in-app messages may appear, so a hide keeps banners and modals off a match screen with no second API to call. Content that becomes eligible while hidden is kept and released one at a time after the next show call, in its existing priority order.

同樣的兩個 App Inbox 顯示與隱藏呼叫,現在也決定 In-App Message 是否能出現,因此隱藏即可讓橫幅與彈窗不出現在戰鬥畫面,不需要另一個 API。隱藏期間符合條件的內容會被保留,並在下一次顯示呼叫後依原本的優先順序逐一釋出。

同样的两个 App Inbox 显示与隐藏调用,现在也决定 In-App Message 是否能出现,因此隐藏即可让横幅与弹窗不出现在战斗界面,不需要另一个 API。隐藏期间符合条件的内容会被保留,并在下一次显示调用后按原本的优先顺序逐一释出。

VGSDKAppInbox.HideFloatingButton
VGSDKAppInbox.ShowFloatingButton
  1. Review every VGSDKAppInbox.HideFloatingButton call site, because each one now also stops in-app messages from appearing.
  2. Keep the hide calls only on scenes where holding back banners and modals is also what you want.
  3. Call VGSDKAppInbox.ShowFloatingButton as soon as the player reaches a safe scene, so held content is released one at a time.
  4. Re-test your in-app message flow across a hide and show round trip, including content that arrives while hidden.
  1. 檢視每一處 VGSDKAppInbox.HideFloatingButton 呼叫,因為現在每一次都會同時讓 In-App Message 不再出現。
  2. 只在同時希望暫停橫幅與彈窗的場景保留隱藏呼叫。
  3. 玩家一回到安全場景就呼叫 VGSDKAppInbox.ShowFloatingButton,讓保留的內容逐一釋出。
  4. 重新測試隱藏與顯示往返的 In-App Message 流程,包含隱藏期間送達的內容。
  1. 检视每一处 VGSDKAppInbox.HideFloatingButton 调用,因为现在每一次都会同时让 In-App Message 不再出现。
  2. 只在同时希望暂停横幅与弹窗的场景保留隐藏调用。
  3. 玩家一回到安全场景就调用 VGSDKAppInbox.ShowFloatingButton,让保留的内容逐一释出。
  4. 重新测试隐藏与显示往返的 In-App Message 流程,包含隐藏期间送达的内容。

See the usage and full signature in the Integration guide:

Show the app inbox floating buttonHide the app inbox floating button

請在整合指南中查看用法與完整簽名:

顯示收件匣浮動按鈕隱藏收件匣浮動按鈕

请在集成指南中查看用法与完整签名:

显示收件箱悬浮按钮隐藏收件箱悬浮按钮

Your existing calls keep compiling and the button still hides, but any scene where you hid it purely for layout now also holds back in-app messages, so content piles up until you call show again and anything whose own validity window closes while hidden is never seen.

現有呼叫仍可正常編譯,按鈕也照樣隱藏,但凡是僅為版面而隱藏的場景,現在也會一併暫停 In-App Message,內容會持續累積到再次呼叫顯示為止,而在隱藏期間就過期的內容將永遠不會被看到。

现有调用仍可正常编译,按钮也照样隐藏,但凡是仅为版面而隐藏的场景,现在也会一并暂停 In-App Message,内容会持续累积到再次调用显示为止,而在隐藏期间就过期的内容将永远不会被看到。