-
public final class SubscriptionOfferStandardized subscription discount/promotional offer. Provides a unified interface for subscription offers across iOS and Android.
Both platforms support subscription offers with different implementations:
iOS: Introductory offers, promotional offers with server-side signatures
Android: Offer tokens with pricing phases
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSubscriptionOffer.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StringbasePlanIdAndroidprivate final Stringcurrencyprivate final StringdisplayPriceprivate final Stringidprivate final InstallmentPlanDetailsAndroidinstallmentPlanDetailsAndroidprivate final StringkeyIdentifierIOSprivate final StringlocalizedPriceIOSprivate final StringnonceIOSprivate final IntegernumberOfPeriodsIOSprivate final List<String>offerTagsAndroidprivate final StringofferTokenAndroidprivate final PaymentModepaymentModeprivate final SubscriptionPeriodperiodprivate final IntegerperiodCountprivate final Doublepriceprivate final PricingPhasesAndroidpricingPhasesAndroidprivate final StringsignatureIOSprivate final DoubletimestampIOSprivate final DiscountOfferTypetype
-
Constructor Summary
Constructors Constructor Description SubscriptionOffer(String basePlanIdAndroid, String currency, String displayPrice, String id, InstallmentPlanDetailsAndroid installmentPlanDetailsAndroid, String keyIdentifierIOS, String localizedPriceIOS, String nonceIOS, Integer numberOfPeriodsIOS, List<String> offerTagsAndroid, String offerTokenAndroid, PaymentMode paymentMode, SubscriptionPeriod period, Integer periodCount, Double price, PricingPhasesAndroid pricingPhasesAndroid, String signatureIOS, Double timestampIOS, DiscountOfferType type)
-
Method Summary
Modifier and Type Method Description final StringgetBasePlanIdAndroid()Android Base plan identifier. final StringgetCurrency()Currency code (ISO 4217, e.g. final StringgetDisplayPrice()Formatted display price string (e.g., "$9. final StringgetId()Unique identifier for the offer. final InstallmentPlanDetailsAndroidgetInstallmentPlanDetailsAndroid()Android Installment plan details for this subscription offer. final StringgetKeyIdentifierIOS()iOS Key identifier for signature validation. final StringgetLocalizedPriceIOS()iOS Localized price string. final StringgetNonceIOS()iOS Cryptographic nonce (UUID) for signature validation. final IntegergetNumberOfPeriodsIOS()iOS Number of billing periods for this discount. final List<String>getOfferTagsAndroid()Android List of tags associated with this offer. final StringgetOfferTokenAndroid()Android Offer token required for purchase. final PaymentModegetPaymentMode()Payment mode during the offer period final SubscriptionPeriodgetPeriod()Subscription period for this offer final IntegergetPeriodCount()Number of periods the offer applies final DoublegetPrice()Numeric price value final PricingPhasesAndroidgetPricingPhasesAndroid()Android Pricing phases for this subscription offer. final StringgetSignatureIOS()iOS Server-generated signature for promotional offer validation. final DoublegetTimestampIOS()iOS Timestamp when the signature was generated. final DiscountOfferTypegetType()Type of subscription offer (Introductory or Promotional) final Map<String, Object>toJson()-
-
Constructor Detail
-
SubscriptionOffer
SubscriptionOffer(String basePlanIdAndroid, String currency, String displayPrice, String id, InstallmentPlanDetailsAndroid installmentPlanDetailsAndroid, String keyIdentifierIOS, String localizedPriceIOS, String nonceIOS, Integer numberOfPeriodsIOS, List<String> offerTagsAndroid, String offerTokenAndroid, PaymentMode paymentMode, SubscriptionPeriod period, Integer periodCount, Double price, PricingPhasesAndroid pricingPhasesAndroid, String signatureIOS, Double timestampIOS, DiscountOfferType type)
-
-
Method Detail
-
getBasePlanIdAndroid
final String getBasePlanIdAndroid()
Android Base plan identifier. Identifies which base plan this offer belongs to.
-
getCurrency
final String getCurrency()
Currency code (ISO 4217, e.g., "USD")
-
getDisplayPrice
final String getDisplayPrice()
Formatted display price string (e.g., "$9.99/month")
-
getId
final String getId()
Unique identifier for the offer.
iOS: Discount identifier from App Store Connect
Android: offerId from ProductSubscriptionAndroidOfferDetails
-
getInstallmentPlanDetailsAndroid
final InstallmentPlanDetailsAndroid getInstallmentPlanDetailsAndroid()
Android Installment plan details for this subscription offer. Only set for installment subscription plans; null for non-installment plans. Available in Google Play Billing Library 7.0+
-
getKeyIdentifierIOS
final String getKeyIdentifierIOS()
iOS Key identifier for signature validation. Used with server-side signature generation for promotional offers.
-
getLocalizedPriceIOS
final String getLocalizedPriceIOS()
iOS Localized price string.
-
getNonceIOS
final String getNonceIOS()
iOS Cryptographic nonce (UUID) for signature validation. Must be generated server-side for each purchase attempt.
-
getNumberOfPeriodsIOS
final Integer getNumberOfPeriodsIOS()
iOS Number of billing periods for this discount.
-
getOfferTagsAndroid
final List<String> getOfferTagsAndroid()
Android List of tags associated with this offer.
-
getOfferTokenAndroid
final String getOfferTokenAndroid()
Android Offer token required for purchase. Must be passed to requestPurchase() when purchasing with this offer.
-
getPaymentMode
final PaymentMode getPaymentMode()
Payment mode during the offer period
-
getPeriod
final SubscriptionPeriod getPeriod()
Subscription period for this offer
-
getPeriodCount
final Integer getPeriodCount()
Number of periods the offer applies
-
getPricingPhasesAndroid
final PricingPhasesAndroid getPricingPhasesAndroid()
Android Pricing phases for this subscription offer. Contains detailed pricing information for each phase (trial, intro, regular).
-
getSignatureIOS
final String getSignatureIOS()
iOS Server-generated signature for promotional offer validation. Required when applying promotional offers on iOS.
-
getTimestampIOS
final Double getTimestampIOS()
iOS Timestamp when the signature was generated. Used for signature validation.
-
getType
final DiscountOfferType getType()
Type of subscription offer (Introductory or Promotional)
-
-
-
-