Unreal
本指南說明如何在 Unreal Engine 版 SDK 中設定 Promotion 功能。
新增功能¶
- 在 Unreal Editor 選單中點擊 Edit > Project Settings。Project Settings 視窗將會顯示。
-
在 Project Settings 視窗左側面板中,點擊 SDK 下的 Dependency - Android / Dependency - iOS。
-
在 Hive Module 中選擇 Enable HivePromotion。若要在 Unreal Android 環境中使用 Google In-App Review,必須選擇 Enable HivePromotion。
設定 Universal Link¶
Universal Link 支援透過邀請頁面首次安裝和啟動應用程式,以及發放邀請者獎勵。
Note
關於基於 Universal Link 產生邀請者連結所需的其他控制台設定,請參閱開發者網站中的 Promotion 營運指南。
若要在 iOS 上使用 Universal Link,應用程式 entitlements 的 Associated Domains 項目中必須包含服務使用的網域資訊(applinks:)。
Note
在 Hive SDK v4 26.4.1 或更高版本中,當應用程式透過 Universal Link 從終止狀態啟動時,Hive SDK 外掛程式會自動處理 Deep Link。除以下 Associated Domains 設定外,無需進行其他程式碼作業。
在 Unreal Engine 5 中,可以透過 PremadeIOSEntitlements 設定套用 entitlements,無需修改引擎。關於建立和套用 entitlements 檔案的方法,請參閱設定 entitlements (iOS)。
將遊戲使用的網域新增到 entitlements 檔案的 com.apple.developer.associated-domains 陣列中。
<key>com.apple.developer.associated-domains</key>
<array>
<!-- 以下網域是 SDK 範例應用程式中使用的範例。請新增遊戲實際使用的網域。 -->
<string>applinks:hiveota.withhive.com</string>
<string>applinks:dev-promotion.qpyou.cn</string>
<string>applinks:promotion.qpyou.cn</string>
<string>applinks:sandbox-promotion.qpyou.cn</string>
<string>applinks:test-promotion.qpyou.cn</string>
<string>applinks:direct-link.withhive.com</string>
<string>applinks:sandbox-direct-link.withhive.com</string>
<string>applinks:test-direct-link.withhive.com</string>
</array>
可使用以下命令確認網域是否已套用到建置後的應用程式。
在 IOSExport.cs 的 entitlements 產生部分中,新增 com.apple.developer.associated-domains 項目和遊戲使用的網域。關於修改位置,請參閱設定 entitlements (iOS)。
// Add
Text.AppendLine( "\t<key>com.apple.developer.associated-domains</key>");
Text.AppendLine( "\t<array>");
// 以下網域是 SDK 範例應用程式中使用的範例。請新增遊戲實際使用的網域。
Text.AppendLine("\t\t<string>applinks:hiveota.withhive.com</string>");
Text.AppendLine("\t\t<string>applinks:dev-promotion.qpyou.cn</string>");
Text.AppendLine("\t\t<string>applinks:promotion.qpyou.cn</string>");
Text.AppendLine("\t\t<string>applinks:sandbox-promotion.qpyou.cn</string>");
Text.AppendLine("\t\t<string>applinks:test-promotion.qpyou.cn</string>");
Text.AppendLine("\t\t<string>applinks:direct-link.withhive.com</string>");
Text.AppendLine("\t\t<string>applinks:sandbox-direct-link.withhive.com</string>");
Text.AppendLine("\t\t<string>applinks:test-direct-link.withhive.com</string>");
Text.AppendLine( "\t</array>");
// Add End

