docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IAppleExtensions

    Access iOS specific functionality.

    Namespace: UnityEngine.Purchasing
    Assembly: Unity.Purchasing.dll
    Syntax
    [Obsolete("This API is deprecated. Please upgrade to the new APIs introduced in IAP v5. For more information, visit the IAP manual: https://docs.unity.com/ugs/en-us/manual/iap/manual/upgrade-to-iap-v5", false)]
    public interface IAppleExtensions : IStoreExtension

    Properties

    simulateAskToBuy

    For testing purposes only.

    Modify payment request for testing ask-to-buy.

    Declaration
    bool simulateAskToBuy { get; set; }
    Property Value
    Type Description
    bool

    Methods

    ContinuePromotionalPurchases()

    Call the UnityEarlyTransactionObserver.initiateQueuedPayments

    Declaration
    void ContinuePromotionalPurchases()

    FetchStorePromotionOrder(Action<List<Product>>, Action)

    Returns the current promoted product order on the device

    Declaration
    void FetchStorePromotionOrder(Action<List<Product>> successCallback, Action errorCallback)
    Parameters
    Type Name Description
    Action<List<Product>> successCallback

    This action will be called when the fetch is successful. The list of products will be passed through.

    Action errorCallback

    This action will be called when the fetch is in error.

    FetchStorePromotionVisibility(Product, Action<string, AppleStorePromotionVisibility>, Action)

    Returns the current promoted product order on the device

    Declaration
    void FetchStorePromotionVisibility(Product product, Action<string, AppleStorePromotionVisibility> successCallback, Action errorCallback)
    Parameters
    Type Name Description
    Product product

    Product to change visibility.

    Action<string, AppleStorePromotionVisibility> successCallback

    This action will be called when the fetch is successful. The productId and visibility will be passed through.

    Action errorCallback

    This action will be called when the fetch is in error.

    GetIntroductoryPriceDictionary()

    Extracting Introductory Price subscription related product details.

    Declaration
    Dictionary<string, string> GetIntroductoryPriceDictionary()
    Returns
    Type Description
    Dictionary<string, string>

    returns the Introductory Price subscription related product details or an empty dictionary

    GetProductDetails()

    Extracting product details.

    Declaration
    Dictionary<string, string> GetProductDetails()
    Returns
    Type Description
    Dictionary<string, string>

    returns product details or an empty dictionary

    GetTransactionReceiptForProduct(Product)

    Fetch the most recent iOS 6 style transaction receipt for the given product. This is necessary to validate Ask-to-buy purchases, which don't show up in the App Receipt.

    Declaration
    string GetTransactionReceiptForProduct(Product product)
    Parameters
    Type Name Description
    Product product

    The product to fetch the receipt from.

    Returns
    Type Description
    string

    Returns the receipt if the product has a receipt or an empty string.

    PresentCodeRedemptionSheet()

    Initiate Apple Subscription Offer Code redemption API, presentCodeRedemptionSheet

    Declaration
    void PresentCodeRedemptionSheet()

    RefreshAppReceipt(Action<string>, Action<string>)

    Fetch the latest App Receipt from Apple. This requires an Internet connection and will prompt the user for their credentials.

    Declaration
    void RefreshAppReceipt(Action<string> successCallback, Action<string> errorCallback)
    Parameters
    Type Name Description
    Action<string> successCallback

    This action will be called when the refresh is successful. The receipt will be passed through.

    Action<string> errorCallback

    This action will be called when the refresh is in error. The error's details will be passed through.

    RegisterPurchaseDeferredListener(Action<Product>)

    Called when a processing a purchase from Apple that is in the "onProductPurchaseDeferred" state.

    Declaration
    void RegisterPurchaseDeferredListener(Action<Product> callback)
    Parameters
    Type Name Description
    Action<Product> callback

    Action will be called with the product that is in the "onProductPurchaseDeferred" state.

    RestoreTransactions(Action<bool, string>)

    Initiate a request to Apple to restore previously made purchases.

    Declaration
    void RestoreTransactions(Action<bool, string> callback)
    Parameters
    Type Name Description
    Action<bool, string> callback

    Action will be called when the request to Apple comes back. The bool will be true if it was successful with a null string or false if it was not with the error message in the string.

    SetApplicationUsername(string)

    Modify payment request with "applicationUsername" for fraud detection.

    Declaration
    void SetApplicationUsername(string applicationUsername)
    Parameters
    Type Name Description
    string applicationUsername

    The application Username for fraud detection.

    SetStorePromotionOrder(List<Product>)

    Overrides the promoted product order on the device.

    Declaration
    void SetStorePromotionOrder(List<Product> products)
    Parameters
    Type Name Description
    List<Product> products

    The new order of promoted products for the device.

    SetStorePromotionVisibility(Product, AppleStorePromotionVisibility)

    Override the visibility of a product on the device.

    Declaration
    void SetStorePromotionVisibility(Product product, AppleStorePromotionVisibility visible)
    Parameters
    Type Name Description
    Product product

    Product to change visibility.

    AppleStorePromotionVisibility visible

    The new product visibility.

    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)