docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ProductCatalog

    The product catalog represents a list of IAP products, with enough information about each product to do a batch export for Apple's Application Loader or the Google Play CSV import format. To retreive the standard catalog, use ProductCatalog.LoadDefaultCatalog().

    Inheritance
    object
    ProductCatalog
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Purchasing
    Assembly: Unity.Purchasing.dll
    Syntax
    [Serializable]
    public class ProductCatalog

    Fields

    appleSKU

    The apple SKU of the app.

    Declaration
    public string appleSKU
    Field Value
    Type Description
    string

    appleTeamID

    The apple team ID of the app.

    Declaration
    public string appleTeamID
    Field Value
    Type Description
    string

    enableCodelessAutoInitialization

    Enables automatic initialization when using Codeless IAP.

    Declaration
    public bool enableCodelessAutoInitialization
    Field Value
    Type Description
    bool

    enableUnityGamingServicesAutoInitialization

    Enables automatic Unity Gaming Services initialization when using Codeless IAP.

    Declaration
    public bool enableUnityGamingServicesAutoInitialization
    Field Value
    Type Description
    bool

    kCatalogPath

    The path of the catalog file.

    Declaration
    public const string kCatalogPath = "Assets/Resources/IAPProductCatalog.json"
    Field Value
    Type Description
    string

    kPrevCatalogPath

    The previous path of the catalog file used in older versions of Unity IAP.

    Declaration
    public const string kPrevCatalogPath = "Assets/Plugins/UnityPurchasing/Resources/IAPProductCatalog.json"
    Field Value
    Type Description
    string

    Properties

    allProducts

    The collection of all products.

    Declaration
    public ICollection<ProductCatalogItem> allProducts { get; }
    Property Value
    Type Description
    ICollection<ProductCatalogItem>

    allValidProducts

    The collection of all valid products.

    Declaration
    public ICollection<ProductCatalogItem> allValidProducts { get; }
    Property Value
    Type Description
    ICollection<ProductCatalogItem>

    Methods

    Add(ProductCatalogItem)

    Adds an item to the catalog.

    Declaration
    public void Add(ProductCatalogItem item)
    Parameters
    Type Name Description
    ProductCatalogItem item

    The item to be added.

    Deserialize(string)

    Deserializes the catalog from JSON.

    Declaration
    public static ProductCatalog Deserialize(string catalogJSON)
    Parameters
    Type Name Description
    string catalogJSON

    The raw json string of catalog data.

    Returns
    Type Description
    ProductCatalog

    The deserialized Prodcut Catalog.

    FromTextAsset(TextAsset)

    Deserializes the catalog from a text asset.

    Declaration
    public static ProductCatalog FromTextAsset(TextAsset asset)
    Parameters
    Type Name Description
    TextAsset asset

    The text asset.

    Returns
    Type Description
    ProductCatalog

    The deserialized Prodcut Catalog.

    Initialize(IProductCatalogImpl)

    Override the default catalog implementation.

    Declaration
    public static void Initialize(IProductCatalogImpl productCatalogImpl)
    Parameters
    Type Name Description
    IProductCatalogImpl productCatalogImpl

    The product catalog implementation.

    IsEmpty()

    Check if the catalog is empty. A catalog is considered empty when it contains no products with valid IDs.

    Declaration
    public bool IsEmpty()
    Returns
    Type Description
    bool

    A boolean representing whether or not the catalog is empty.

    LoadDefaultCatalog()

    Loads the default catalog.

    Declaration
    public static ProductCatalog LoadDefaultCatalog()
    Returns
    Type Description
    ProductCatalog

    The ProductCatalog instance.

    Remove(ProductCatalogItem)

    Removes an item to the catalog.

    Declaration
    public void Remove(ProductCatalogItem item)
    Parameters
    Type Name Description
    ProductCatalogItem item

    The item to be removed.

    Serialize(ProductCatalog)

    Serializes the catalog to JSON.

    Declaration
    public static string Serialize(ProductCatalog catalog)
    Parameters
    Type Name Description
    ProductCatalog catalog

    The catalog.

    Returns
    Type Description
    string

    The raw json string of the catalog data

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)