内购推荐 (IAP Promo) 集成
推荐 (Promotions)

内购推荐 (IAP Promo) 商品目录

Unity IAP provides quick and easy tools to create and export Product Catalogs. Use the Unity Editor’s IAP Catalog window to populate Product metadata, then export the catalog to the Developer Dashboard to configure each Product’s creative assets. Note that you can also manually add Products to your catalog in the dashboard, as detailed below.

创建商品目录

在 IAP Catalog 窗口中添加商品

In the Editor, select Window > UnityIAP > IAP Catalog to open the IAP Catalog window. This GUI lists all of your previously configured Products, and allows you to define the following attributes for each:

  • Name(名称)
  • Product ID(商品 ID)
  • Type (IAP Promo now supports both Consumable and Non-consumable Product types)
  • Price (Unity recommends specifying price points for Google and Apple stores independently if your app supports both)

Note: A Product Catalog must have at least one Product configured to export. For a complete walkthrough on setting up Products, see documentation on Codeless IAP.

You may already use a builder script to populate your Product Catalog for Unity IAP. For example:

var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct(product_coins, ProductType.Consumable);
builder.AddProduct(product_hat, ProductType.NonConsumable);
builder.AddProduct(product_elite, ProductType.Subscription);

因为内购推荐 (IAP Promo) 仅支持从 Editor IAP Catalog GUI 导出 JSON,所以我们建议按如下方式修改您的方法:

  1. Copy-paste your Products into the IAP Catalog GUI.
  2. Remove or comment out existing builder.AddProduct() code from your purchasing script. 3.在初始化 IAP 之前添加以下代码以从 IAP Catalog GUI 获取商品列表:
StandardPurchasingModule module = StandardPurchasingModule.Instance();
ProductCatalog catalog = ProductCatalog.LoadDefaultCatalog();
ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);
IAPConfigurationHelper.PopulateConfigurationBuilder(ref builder, catalog);

UnityPurchasing.Initialize(this, builder);

导出商品目录

In the IAP Catalog window, select App Store Export > Cloud JSON to export a local copy of the Product Catalog.

将商品目录导出到 JSON
将商品目录导出到 JSON

在开发者控制面板 (Developer Dashboard) 中配置创意资源

Manage your Product Catalog on the Operate page of the Developer Dashboard. Your active Project appears in the top-left corner. To manage Products, select Monetization > In-App Purchases from the left navigation bar.

You can populate your Products manually, or bulk-populate them by importing a JSON file.

Creating a Product manually

From the Product configuration menu of the dashboard (Monetization > In-App Purchases), click the ADD NEW PRODUCT button in the top-right corner, then enter the following details:

  • Product ID (for reference in your IAP code)
  • Name(名称)
  • Type (Consumable or Non-Consumable)
  • Apple App Store Price (USD)
  • Google Play Store Price (USD)
Adding a new IAP Product manually on the Developer Dashboard
Adding a new IAP Product manually on the Developer Dashboard

Click the SAVE button to store the Product in your catalog.

Importing a Product Catalog

要设置新的__商品目录__或更新目录中的现有__商品__:

1.选择 UPLOAD JSON。 2. Select the JSON file you exported from the Unity Editor. A diff log then prompts you to approve changes. Check the contents of the file, then select APPROVE CHANGES.

将 IAP 商品目录导入开发者控制面板 (Developer Dashboard)
将 IAP 商品目录导入开发者控制面板 (Developer Dashboard)

导入的__商品__将出现在 Product Catalog(商品目录)列表中。但是,为了符合__推荐 (Promotions)__ 的条件,每个__商品__必须具有关联的创意资源(否则__广告位__无法显示任何内容)。

分配创意资源

要添加创意资源,请遵循以下步骤:

  1. Select a Product from the Product Catalog list, then scroll down to the Creative Uploads section.

    Note: While each Product’s Product ID, Name, Price, and Type appear in the dashboard, you can only edit these attributes from the Editor’s IAP Catalog window.

    2.要为不同区域指定独特的创意资源,请选择 ADD LANGUAGE,然后选中要包含的语言。



    Incorporating unique creative assets for different languages in the Developer Dashboard
    注意:下拉列表会显示正在编辑的当前语言。如果添加的语言没有创意资源,则会默认使用其 English (United States)(美国英语)创意资源。

3.按照以下准则,为手机和平板电脑设备上传纵向 (Portrait) 或横向 (Landscape) 创意资源:

* PNG 或 JPG 文件格式。 * 每个__商品__要求一个创意资源至少有一种配置才符合__推荐 (Promotions)__ 的条件。为了获得更好的消费体验,请为每种设备和方向提供经过优化的创意资源。 * 手机创意资源尺寸为 580 x 1035 像素(纵向方向)或 1035 x 580 像素(横向方向)。 * 平板电脑创意资源尺寸为 900 x 1200 像素(纵向方向)或 1200 x 900 像素(横向方向)。 4.选择 UPLOAD CREATIVE 以便上传创意资源。左侧会显示预览。 5.按照以下准则,选择 UPLOAD PURCHASE BUTTON 将一个交互式按钮置于创意资源上:

* 必须上传购买按钮才能继续。 * 按钮资源的最小文件大小为 60 x 60 像素。 * 可以单击并拖动预览窗口上的购买按钮来放置该按钮。 * 可以设置按钮文本的字体、颜色和大小。

开发者控制面板 (Developer Dashboard) 中的创意资源上传界面概览 6. Select SAVE to proceed. Upon returning to the Product Catalog page, your Product is now Promotion-eligible__, as indicated by the Creative Attached column.

A Product that is now eligible for use in Promotions in the Developer Dashboard

Note: You must also submit your Product Catalog to the appropriate Google Play or iTunes store for the purchase flow to work. Please see the Export section in the documentation on Codeless IAP.


内购推荐 (IAP Promo) 集成
推荐 (Promotions)