Version: 2022.2
针对 Windows 应用商店进行配置
Codeless IAP

Amazon Appstore 的配置

简介

本指南介绍如何设置 Amazon Appstore 与 Unity 应用内购 (IAP) 系统配合使用。此设置过程包括建立数字记录和关系;与 Unity IAP API 进行交互、设置 Amazon 开发者帐户以及测试和发布 Unity IAP 应用程序都需要用到这些记录和关系。

与其他平台一样,Amazon 应用商店允许购买虚拟商品和所管理的商品。这些数字商品的标识包括一个字符串标识符和一个额外用于定义耐用性的类型,其中的类型选项包括订阅(可以订阅)、消耗品(可以多次购买)以及非消耗品(可以购买一次)。

跨店实现 IAP

There are cross-store installation issues with publishing to multiple Android IAP stores (for example, Amazon and Google) simultaneously and shared Android bundle identifiers. For more information, refer to Cross-store installation issues with Android in-app purchase stores.

Amazon Appstore

准备开始

  1. Amazon Developer Portal 中设立 Amazon 开发者帐户。
  2. Write a game implementing the Unity IAP API. Refer to the guides on Unity IAP initialization. Use the Amazon Appstore for apps with no restrictions on IAP items.

设备设置

  1. 对于 Android 设备,下载并安装 Amazon Appstore

  2. For FireOS devices, the Amazon Appstore should come pre-installed.

    Note: Although you can freely target FireOS devices, FireOS is not a Unity-supported platform.

  3. After you have installed the Amazon Appstore, install the Amazon App Tester.

  4. Set up the Android SDK
    1. 要安装并查看 Android 调试日志,请确保已安装 Android SDK。从 Android SDK 安装页面下载相关命令行工具包,然后将其解压缩到您的计算机。
    2. 确认 SDK 能通过命令行 adb 工具识别连接的 Android 设备。例如:
|[11:07:01] user@laptop:/Applications | $ adb devices
List of devices attached
00DA0807526300W5    device

Unity 应用程序设置

为了使用 Unity 的 IAP,需要执行几个设置步骤。

  1. Import the Unity IAP plug-in. For more information, refer to Setting up Unity IAP (Unity 5.3 or later).

  2. 设置 IAP 目标商店。您应该已经设置好一个 Android 应用程序。请使用 Unity IAP Window > Unity IAP > Android > Target Amazon 菜单项来设置目标商店。此菜单项用于在 Google、Amazon 和其他 Android 应用商店之间切换。

或者,请调用 API:

UnityPurchasingEditor.TargetAndroidStore(AndroidStore.AmazonAppStore)

Amazon Appstore 设置

You do not have to download Amazon’s native IAP plug-in when preparing to use the Amazon stores, because all of the functionality that it provides is already included in Unity’s IAP service.

  1. 添加您的应用程序。从 Amazon Developer Portal 中选择 Add a New App

  2. 设置您的目录。使用您事先准备的商品描述,通过 Amazon Developer Portal 将商品添加到 Amazon 目录。导航至应用程序的页面,然后找到 In-App Items 部分。使用 Add a ConsumableAdd an EntitlementAdd a Subscription 按钮来设置您的目录。

针对 Windows 应用商店进行配置
Codeless IAP