docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface INativeStore

    An interface to native underlying store systems. Provides a base for opaquely typed communication across a language-bridge upon which additional functionality can be composed. Is used by most public IStore implementations which themselves are owned by the purchasing core.

    Namespace: UnityEngine.Purchasing
    Assembly: Unity.Purchasing.dll
    Syntax
    public interface INativeStore

    Methods

    CheckEntitlement(string)

    Checks if the Product in question has been purchased. For Consumable Products, this will only be true for those whose transactions are not completed. For Subscriptions, this will check that the subscription is still active, according to the store it is purchased from.

    Declaration
    bool CheckEntitlement(string productJSON)
    Parameters
    Type Name Description
    string productJSON

    The Product to check for Entitlement, in JSON format.

    Returns
    Type Description
    bool

    Whether the product is entitled or not.

    Connect()

    Initializes a connection to the store.

    Declaration
    void Connect()

    FetchExistingPurchases()

    Call the Store to retrieve existing purchases.

    Declaration
    void FetchExistingPurchases()

    FetchProducts(string)

    Call the Store to retrieve the store products. The IStoreCallback will be call with the retrieved products.

    Declaration
    void FetchProducts(string json)
    Parameters
    Type Name Description
    string json

    The catalog of products to retrieve the store information from in JSON format.

    FinishTransaction(string, string)

    Call the Store to consume a product.

    Declaration
    void FinishTransaction(string productJSON, string transactionID)
    Parameters
    Type Name Description
    string productJSON

    Product to consume in JSON format.

    string transactionID

    The transaction id of the receipt to close.

    Purchase(string, string)

    Call the Store to purchase a product. The IStoreCallback will be call when the purchase is successful.

    Declaration
    void Purchase(string productJson, string optionsJson)
    Parameters
    Type Name Description
    string productJson

    The product to buy in JSON format.

    string optionsJson

    A string used by some stores to fight fraudulent transactions.

    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)