docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SubscriptionManager

    Use to query in-app purchasing subscription product information, and upgrade subscription products. Supports the Apple App Store, Google Play store. Note expiration dates may become invalid after updating subscriptions between two types of duration.

    Inheritance
    object
    SubscriptionInfoHelper
    SubscriptionManager
    Inherited Members
    SubscriptionInfoHelper.GetSubscriptionInfo()
    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.Stores.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 class SubscriptionManager : SubscriptionInfoHelper

    Constructors

    SubscriptionManager(string, string, string)

    Construct an object that allows inspection of a subscription product.

    Declaration
    public SubscriptionManager(string receipt, string id, string intro_json)
    Parameters
    Type Name Description
    string receipt

    A Unity IAP unified receipt from Product.receipt.receipt

    string id

    A product identifier.

    string intro_json

    From IAppleExtensions.GetIntroductoryPriceDictionary.GetIntroductoryPriceDictionary

    See Also
    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    SubscriptionManager(Product, string)

    Construct an object that allows inspection of a subscription product.

    Declaration
    [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 SubscriptionManager(Product product, string intro_json)
    Parameters
    Type Name Description
    Product product

    Subscription to be inspected

    string intro_json

    From IAppleExtensions.GetIntroductoryPriceDictionary.GetIntroductoryPriceDictionary

    See Also
    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    Methods

    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    Performs subscription updating, migrating a subscription into another as long as they are both members of the same subscription group on the App Store.

    Declaration
    public static void UpdateSubscription(Product newProduct, Product oldProduct, string developerPayload, Action<Product, string> appleStore, Action<string, string> googleStore)
    Parameters
    Type Name Description
    Product newProduct

    Destination subscription product, belonging to the same subscription group as oldProduct

    Product oldProduct

    Source subscription product, belonging to the same subscription group as newProduct

    string developerPayload

    Carried-over metadata from prior call to SubscriptionManager.UpdateSubscription.UpdateSubscription

    Action<Product, string> appleStore

    Triggered upon completion of the subscription update.

    Action<string, string> googleStore

    Triggered upon completion of the subscription update.

    See Also
    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    UpdateSubscriptionInAppleStore(Product, string, Action<Product, string>)

    Performs subscription updating, migrating a subscription into another as long as they are both members of the same subscription group on the App Store.

    Declaration
    public static void UpdateSubscriptionInAppleStore(Product newProduct, string developerPayload, Action<Product, string> appleStoreUpdateCallback)
    Parameters
    Type Name Description
    Product newProduct

    Destination subscription product, belonging to the same subscription group as oldProduct

    string developerPayload

    Carried-over metadata from prior call to SubscriptionManager.UpdateSubscription.UpdateSubscription

    Action<Product, string> appleStoreUpdateCallback

    Triggered upon completion of the subscription update.

    See Also
    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    UpdateSubscriptionInGooglePlayStore(Product, Product, Action<string, string>)

    Performs subscription updating, migrating a subscription into another as long as they are both members of the same subscription group on the App Store.

    Declaration
    public static void UpdateSubscriptionInGooglePlayStore(Product oldProduct, Product newProduct, Action<string, string> googlePlayUpdateCallback)
    Parameters
    Type Name Description
    Product oldProduct

    Source subscription product, belonging to the same subscription group as newProduct

    Product newProduct

    Destination subscription product, belonging to the same subscription group as oldProduct

    Action<string, string> googlePlayUpdateCallback

    Triggered upon completion of the subscription update.

    See Also
    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    getSubscriptionInfo()

    Convert my Product into a SubscriptionInfo. My Product.receipt must have a "Payload" JSON key containing supported native app store information, which will be converted here.

    Declaration
    public SubscriptionInfo getSubscriptionInfo()
    Returns
    Type Description
    SubscriptionInfo

    Returns the SubscriptionInfo

    Exceptions
    Type Condition
    NullProductIdException

    My Product must have a non-null product identifier

    StoreSubscriptionInfoNotSupportedException

    A supported app store must be used as my product

    NullReceiptException

    My product must have a receipt

    InvalidProductTypeException

    For non-subscription product types

    See Also
    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)

    See Also

    GetIntroductoryPriceDictionary()
    UpdateSubscription(Product, Product, string, Action<Product, string>, Action<string, string>)
    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)