docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IGooglePlayStoreExtensions

    Access GooglePlay store 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 IGooglePlayStoreExtensions : IStoreExtension

    Methods

    ConfirmSubscriptionPriceChange(string, Action<bool>)

    Initiate a flow to confirm the change of price for an item subscribed by the user.

    Declaration
    [Obsolete("No longer functional. This calls launchPriceChangeConfirmationFlow which was removed from Google Play Billing Library 6.0.0")]
    void ConfirmSubscriptionPriceChange(string productId, Action<bool> callback)
    Parameters
    Type Name Description
    string productId

    Product id

    Action<bool> callback

    Price changed event finished successfully

    GetObfuscatedAccountId(Product)

    Returns the obfuscated account id of the user who made the purchase. This requires using IGooglePlayConfiguration.SetObfuscatedAccountId.SetObfuscatedAccountId before the purchase is made. getAccountIdentifiers

    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)]
    string GetObfuscatedAccountId(Product product)
    Parameters
    Type Name Description
    Product product

    Product

    Returns
    Type Description
    string

    Returns the obfuscated account id if it exists, otherwise null is returned.

    GetObfuscatedProfileId(Product)

    Returns the obfuscated profile id of the user who made the purchase. This requires using IGooglePlayConfiguration.SetObfuscatedProfileId.SetObfuscatedProfileId before the purchase is made. getAccountIdentifiers

    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)]
    string GetObfuscatedProfileId(Product product)
    Parameters
    Type Name Description
    Product product

    Product

    Returns
    Type Description
    string

    Returns the obfuscated profile id if it exists, otherwise null is returned.

    GetPurchaseState(Product)

    Returns the purchase state of a product in the Google Play Store. getPurchaseState

    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)]
    GooglePurchaseState GetPurchaseState(Product product)
    Parameters
    Type Name Description
    Product product

    Product

    Returns
    Type Description
    GooglePurchaseState

    Returns the purchase state when successful, otherwise an exception is thrown.

    IsPurchasedProductDeferred(Product)

    Determines if the purchase of a product in the Google Play Store is deferred based on its receipt. This indicates if there is an additional step to complete a transaction in between when a user initiates a purchase and when the payment method for the purchase is processed. Handling pending transactions

    Declaration
    bool IsPurchasedProductDeferred(Product product)
    Parameters
    Type Name Description
    Product product

    Product

    Returns
    Type Description
    bool

    trueif the input contains a receipt for a deferred or a pending transaction for a Google Play billing purchase, and false otherwise.

    RestoreTransactions(Action<bool, string>)

    Async call to the google store to queryPurchases using all the different support sku types.

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

    Will be called as often as many purchases the queryPurchases finds (the IStoreCallback will be called as well). 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.

    UpgradeDowngradeSubscription(string, string)

    Upgrade or downgrade subscriptions, with proration mode IMMEDIATE_WITHOUT_PRORATION by default See more

    Declaration
    void UpgradeDowngradeSubscription(string oldSku, string newSku)
    Parameters
    Type Name Description
    string oldSku

    current subscription

    string newSku

    new subscription to subscribe

    UpgradeDowngradeSubscription(string, string, int)

    Upgrade or downgrade subscriptions

    Declaration
    void UpgradeDowngradeSubscription(string oldSku, string newSku, int desiredProrationMode)
    Parameters
    Type Name Description
    string oldSku

    current subscription

    string newSku

    new subscription to subscribe

    int desiredProrationMode

    Specifies the mode of proration. See more

    UpgradeDowngradeSubscription(string, string, GooglePlayProrationMode)

    Upgrade or downgrade subscriptions

    Declaration
    void UpgradeDowngradeSubscription(string oldSku, string newSku, GooglePlayProrationMode desiredProrationMode)
    Parameters
    Type Name Description
    string oldSku

    current subscription

    string newSku

    new subscription to subscribe

    GooglePlayProrationMode desiredProrationMode

    Specifies the mode of proration. See more

    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)