@@ -1529,6 +1529,7 @@ class PurchaseIOS extends Purchase implements PurchaseCommon {
15291529 this .quantityIOS,
15301530 this .reasonIOS,
15311531 this .reasonStringRepresentationIOS,
1532+ this .renewalInfoIOS,
15321533 this .revocationDateIOS,
15331534 this .revocationReasonIOS,
15341535 this .storefrontCountryCodeIOS,
@@ -1564,6 +1565,7 @@ class PurchaseIOS extends Purchase implements PurchaseCommon {
15641565 final int ? quantityIOS;
15651566 final String ? reasonIOS;
15661567 final String ? reasonStringRepresentationIOS;
1568+ final RenewalInfoIOS ? renewalInfoIOS;
15671569 final double ? revocationDateIOS;
15681570 final String ? revocationReasonIOS;
15691571 final String ? storefrontCountryCodeIOS;
@@ -1600,6 +1602,7 @@ class PurchaseIOS extends Purchase implements PurchaseCommon {
16001602 quantityIOS: json['quantityIOS' ] as int ? ,
16011603 reasonIOS: json['reasonIOS' ] as String ? ,
16021604 reasonStringRepresentationIOS: json['reasonStringRepresentationIOS' ] as String ? ,
1605+ renewalInfoIOS: json['renewalInfoIOS' ] != null ? RenewalInfoIOS .fromJson (json['renewalInfoIOS' ] as Map <String , dynamic >) : null ,
16031606 revocationDateIOS: (json['revocationDateIOS' ] as num ? )? .toDouble (),
16041607 revocationReasonIOS: json['revocationReasonIOS' ] as String ? ,
16051608 storefrontCountryCodeIOS: json['storefrontCountryCodeIOS' ] as String ? ,
@@ -1640,6 +1643,7 @@ class PurchaseIOS extends Purchase implements PurchaseCommon {
16401643 'quantityIOS' : quantityIOS,
16411644 'reasonIOS' : reasonIOS,
16421645 'reasonStringRepresentationIOS' : reasonStringRepresentationIOS,
1646+ 'renewalInfoIOS' : renewalInfoIOS? .toJson (),
16431647 'revocationDateIOS' : revocationDateIOS,
16441648 'revocationReasonIOS' : revocationReasonIOS,
16451649 'storefrontCountryCodeIOS' : storefrontCountryCodeIOS,
@@ -1839,21 +1843,77 @@ class RefundResultIOS {
18391843 }
18401844}
18411845
1846+ /// Subscription renewal information from Product.SubscriptionInfo.RenewalInfo
1847+ /// https://developer.apple.com/documentation/storekit/product/subscriptioninfo/renewalinfo
18421848class RenewalInfoIOS {
18431849 const RenewalInfoIOS ({
18441850 this .autoRenewPreference,
1851+ /// When subscription expires due to cancellation/billing issue
1852+ /// Possible values: "VOLUNTARY", "BILLING_ERROR", "DID_NOT_AGREE_TO_PRICE_INCREASE", "PRODUCT_NOT_AVAILABLE", "UNKNOWN"
1853+ this .expirationReason,
1854+ /// Grace period expiration date (milliseconds since epoch)
1855+ /// When set, subscription is in grace period (billing issue but still has access)
1856+ this .gracePeriodExpirationDate,
1857+ /// True if subscription failed to renew due to billing issue and is retrying
1858+ /// Note: Not directly available in RenewalInfo, available in Status
1859+ this .isInBillingRetry,
18451860 this .jsonRepresentation,
1861+ /// Product ID that will be used on next renewal (when user upgrades/downgrades)
1862+ /// If set and different from current productId, subscription will change on expiration
1863+ this .pendingUpgradeProductId,
1864+ /// User's response to subscription price increase
1865+ /// Possible values: "AGREED", "PENDING", null (no price increase)
1866+ this .priceIncreaseStatus,
1867+ /// Expected renewal date (milliseconds since epoch)
1868+ /// For active subscriptions, when the next renewal/charge will occur
1869+ this .renewalDate,
1870+ /// Offer ID applied to next renewal (promotional offer, subscription offer code, etc.)
1871+ this .renewalOfferId,
1872+ /// Type of offer applied to next renewal
1873+ /// Possible values: "PROMOTIONAL", "SUBSCRIPTION_OFFER_CODE", "WIN_BACK", etc.
1874+ this .renewalOfferType,
18461875 required this .willAutoRenew,
18471876 });
18481877
18491878 final String ? autoRenewPreference;
1879+ /// When subscription expires due to cancellation/billing issue
1880+ /// Possible values: "VOLUNTARY", "BILLING_ERROR", "DID_NOT_AGREE_TO_PRICE_INCREASE", "PRODUCT_NOT_AVAILABLE", "UNKNOWN"
1881+ final String ? expirationReason;
1882+ /// Grace period expiration date (milliseconds since epoch)
1883+ /// When set, subscription is in grace period (billing issue but still has access)
1884+ final double ? gracePeriodExpirationDate;
1885+ /// True if subscription failed to renew due to billing issue and is retrying
1886+ /// Note: Not directly available in RenewalInfo, available in Status
1887+ final bool ? isInBillingRetry;
18501888 final String ? jsonRepresentation;
1889+ /// Product ID that will be used on next renewal (when user upgrades/downgrades)
1890+ /// If set and different from current productId, subscription will change on expiration
1891+ final String ? pendingUpgradeProductId;
1892+ /// User's response to subscription price increase
1893+ /// Possible values: "AGREED", "PENDING", null (no price increase)
1894+ final String ? priceIncreaseStatus;
1895+ /// Expected renewal date (milliseconds since epoch)
1896+ /// For active subscriptions, when the next renewal/charge will occur
1897+ final double ? renewalDate;
1898+ /// Offer ID applied to next renewal (promotional offer, subscription offer code, etc.)
1899+ final String ? renewalOfferId;
1900+ /// Type of offer applied to next renewal
1901+ /// Possible values: "PROMOTIONAL", "SUBSCRIPTION_OFFER_CODE", "WIN_BACK", etc.
1902+ final String ? renewalOfferType;
18511903 final bool willAutoRenew;
18521904
18531905 factory RenewalInfoIOS .fromJson (Map <String , dynamic > json) {
18541906 return RenewalInfoIOS (
18551907 autoRenewPreference: json['autoRenewPreference' ] as String ? ,
1908+ expirationReason: json['expirationReason' ] as String ? ,
1909+ gracePeriodExpirationDate: (json['gracePeriodExpirationDate' ] as num ? )? .toDouble (),
1910+ isInBillingRetry: json['isInBillingRetry' ] as bool ? ,
18561911 jsonRepresentation: json['jsonRepresentation' ] as String ? ,
1912+ pendingUpgradeProductId: json['pendingUpgradeProductId' ] as String ? ,
1913+ priceIncreaseStatus: json['priceIncreaseStatus' ] as String ? ,
1914+ renewalDate: (json['renewalDate' ] as num ? )? .toDouble (),
1915+ renewalOfferId: json['renewalOfferId' ] as String ? ,
1916+ renewalOfferType: json['renewalOfferType' ] as String ? ,
18571917 willAutoRenew: json['willAutoRenew' ] as bool ,
18581918 );
18591919 }
@@ -1862,7 +1922,15 @@ class RenewalInfoIOS {
18621922 return {
18631923 '__typename' : 'RenewalInfoIOS' ,
18641924 'autoRenewPreference' : autoRenewPreference,
1925+ 'expirationReason' : expirationReason,
1926+ 'gracePeriodExpirationDate' : gracePeriodExpirationDate,
1927+ 'isInBillingRetry' : isInBillingRetry,
18651928 'jsonRepresentation' : jsonRepresentation,
1929+ 'pendingUpgradeProductId' : pendingUpgradeProductId,
1930+ 'priceIncreaseStatus' : priceIncreaseStatus,
1931+ 'renewalDate' : renewalDate,
1932+ 'renewalOfferId' : renewalOfferId,
1933+ 'renewalOfferType' : renewalOfferType,
18661934 'willAutoRenew' : willAutoRenew,
18671935 };
18681936 }
0 commit comments