SubscriptionInfo class reference

Unity IAP provides detailed subscription product information through the SubsciptionInfo class.

SubscriptionInfo class methods

The SubscriptionInfo class is a container for a product’s subscription-related information.

The following methods are available in the SubscriptionInfo class:

MethodDescription
public string GetProductId()Returns a product’s store ID.
public DateTime GetPurchaseDate()Returns the product’s purchase date.
For Apple, the purchase date is the date when the subscription was either purchased or renewed. For Google, the purchase date is the date when the subscription was originally purchased.
public Result IsSubscribed()Indicates if a product is currently subscribed.
Non-renewable products in the Apple store return a Result.Unsupported value. Auto-renewable products in the Apple store and subscription products in the Google Play store return a Result.True or Result.False value.
public Result IsExpired()Indicates if the subscription has expired.
* Non-renewable products in the Apple store return a Result.Unsupported value.
* Auto-renewable products in the Apple store and subscription products in the Google Play store return a Result.True or Result.False value.
public Result IsCancelled()Indicates if the subscription has been cancelled. A cancelled subscription means the product is currently subscribed, but does not renew on the next billing date.
Non-renewable products in the Apple store return a Result.Unsupported value. Auto-renewable products in the Apple store and subscription products in the Google Play store return a Result.True or Result.False value.
public Result IsFreeTrial()Indicates if the product is in a free trial.
* Products in the Google Play store return Result.Unsupported if the application does not support version 6+ of the Android in-app billing API.
Non-renewable products in the Apple store return a Result.Unsupported value. Auto-renewable products in the Apple store and subscription products in the Google Play store return a Result.True or Result.False value.
public Result IsAutoRenewing()Indicates if the subscription is auto-renewable.
Non-renewable products in the Apple store return a Result.Unsupported value. Auto-renewable products in the Apple store and subscription products in the Google Play store return a Result.True or Result.False value.
public TimeSpan GetRemainingTime()Returns a TimeSpan to indicate the time remaining until the next billing date.
Products in the Google Play store return TimeSpan.MaxValue if the application does not support version 6+ of the Android in-app billing API.
public Result IsIntroductoryPricePeriod()Indicates if the subscription is in an introductory price period.
Non-renewable products in the Apple store return a Result.Unsupported value. Auto-renewable products in the Apple store and subscription products in the Google Play store return a Result.True or Result.False value. Products in the Google Play store return Result.Unsupported if the application does not support version 6+ of the Android in-app billing API.
public TimeSpan GetIntroductoryPricePeriod()Returns a TimeSpan to indicate how much time remains for the introductory price period.
Subscription products with no introductory price period return TimeSpan.Zero. Products in the Apple store return TimeSpan.Zero if the application does not support iOS version 11.2+, macOS 10.13.2+, or tvOS 11.2+.
public long GetIntroductoryPricePeriodCycles()Returns number of introductory price cycles.
Products in the Apple store return 0 if the application does not support iOS version 11.2+, macOS 10.13.2+, or tvOS 11.2+.
public string GetIntroductoryPrice()Returns the introductory price string.
Products with no introductory price return a "not available" value. Apple store products with an introductory price return a value formatted as “0.99USD”. Google Play products with an introductory price return a value formatted as “$0.99”. Products in the Apple store return “not available” if the application does not support iOS version 11.2+, macOS 10.13.2+, or tvOS 11.2+.
public DateTime GetExpireDate()Returns the date of the Product’s next auto-renew or expiration (for a cancelled auto-renewing subscription).
Products in the Google Play store return TimeSpan.MaxValue if the application does not support version 6+ of the Android in-app billing API.