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.
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:
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,所以我们建议按如下方式修改您的方法:
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.
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.
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:
Click the SAVE button to store the Product in your 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.
导入的__商品__将出现在 Product Catalog(商品目录)列表中。但是,为了符合__推荐 (Promotions)__ 的条件,每个__商品__必须具有关联的创意资源(否则__广告位__无法显示任何内容)。
要添加创意资源,请遵循以下步骤:
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 像素。
* 可以单击并拖动预览窗口上的购买按钮来放置该按钮。
* 可以设置按钮文本的字体、颜色和大小。
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.
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.