SubscriptionInfo class reference
Reference the `SubscriptionInfo` class methods to retrieve subscription product information and status.
阅读时间3 分钟最后更新于 9 天前
Unity IAP provides detailed subscription product information through the
SubscriptionInfoSubscriptionInfo class methods
TheSubscriptionInfo
The following methods are available in the
SubscriptionInfoMethod | Description |
|---|---|
| Returns a product’s store ID. |
| 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. |
| Indicates if a product is currently subscribed. Non-renewable products in the Apple App Store return a |
| Indicates if the subscription has expired. * Non-renewable products in the Apple App Store return a * Auto-renewable products in the Apple App Store and subscription products in the Google Play Store return a |
| Indicates if the subscription has been cancelled. A cancelled subscription means the product is currently subscribed, but will not renew on the next billing date. For Apple, this is determined by the cancellation date. For Google, this is determined by the auto-renew status. Non-renewable products in the Apple App Store return a |
| Indicates if the product is in a free trial. Non-renewable products in the Apple App Store return a |
| Indicates if the subscription is auto-renewable. For Apple, this is computed based on product type, cancellation status, and expiration status. For Google, this returns the stored auto-renew flag. Non-renewable products in the Apple App Store return a |
| Returns a TimeSpan indicating the time remaining until the next billing date. Non-renewable products in the Apple App Store return |
| Indicates if the subscription is in an introductory price period. Non-renewable products in the Apple App Store return a Auto-renewable products in the Apple App Store and subscription products in the Google Play Store return a |
| Returns a Subscription products with no introductory price period return |
| Returns number of introductory price cycles. Products in the Apple App Store return 0 if the application does not support iOS version 11.2+, macOS 10.13.2+, or tvOS 11.2+. |
| Returns the introductory price string. Products with no introductory price return a |
| Returns the date of the product's next auto-renew or expiration (for a cancelled auto-renewing subscription). |
| Returns the date when the subscription was cancelled. Apple App Store: Returns the cancellation date from the receipt. Google Play Store: Not supported - returns |
| Returns the duration of the free trial period. Google Play Store: Returns the configured free trial duration from the product details. Apple App Store: Not supported - returns |
| Returns the duration of the subscription billing period. Google Play Store: Returns the subscription period from the product details. Apple App Store: Not supported - returns |
| Returns the free trial period as an ISO8601 duration string (e.g., "P1W" for one week). However, this method only returns useful data for the Google Play Store. For the Apple App Store, this returns |
| Returns the raw JSON SkuDetails from the Google Play API. For the Apple App Store, this returns |
| Returns a JSON string with the subscription data, including Used internally for subscription updates to the Google Play Store. |