虚幻
本指南说明如何在 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

