OfferInfo

data class OfferInfo(val productId: String, val basePlanId: String?, val offerId: String?, val offerToken: String, val offerTags: List<String>, val pricingPhases: List<ProductDetails.PricingPhase>, val isFreeTrial: Boolean, val trialPeriod: String?, val trialPhase: ProductDetails.PricingPhase?, val hasIntroPrice: Boolean, val introPrice: String?, val introPriceMicros: Long, val introPeriod: String?, val introCycleCount: Int, val introPhase: ProductDetails.PricingPhase?, val basePrice: String, val basePriceMicros: Long, val billingPeriod: String?, val currencyCode: String, val basePhase: ProductDetails.PricingPhase?)

Typed view over a subscription ProductDetails.SubscriptionOfferDetails, surfacing the trial / intro / base pricing phases as flat fields for easy UI binding.

Each Play subscription offer can have up to three pricing phases:

  • free trialpriceAmountMicros == 0, RecurrenceMode.FINITE_RECURRING

  • introductorypriceAmountMicros > 0, RecurrenceMode.FINITE_RECURRING

  • baseRecurrenceMode.INFINITE_RECURRING

Use AppPurchase.getOffers, AppPurchase.getTrialOffer, or AppPurchase.getBaseOffer to obtain instances — do not construct directly.

Since

3.5.7

Constructors

Link copied to clipboard
constructor(productId: String, basePlanId: String?, offerId: String?, offerToken: String, offerTags: List<String>, pricingPhases: List<ProductDetails.PricingPhase>, isFreeTrial: Boolean, trialPeriod: String?, trialPhase: ProductDetails.PricingPhase?, hasIntroPrice: Boolean, introPrice: String?, introPriceMicros: Long, introPeriod: String?, introCycleCount: Int, introPhase: ProductDetails.PricingPhase?, basePrice: String, basePriceMicros: Long, billingPeriod: String?, currencyCode: String, basePhase: ProductDetails.PricingPhase?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val basePhase: ProductDetails.PricingPhase?

Raw base phase, or null.

Link copied to clipboard

Base plan id from Play Console (null on legacy or simple offers).

Link copied to clipboard

Locale-formatted base price (e.g. "$9.99"); empty if no base phase exists.

Link copied to clipboard

Base price in micros, or 0.

Link copied to clipboard

ISO-8601 base billing cycle (e.g. "P1M", "P1Y"), or null.

Link copied to clipboard

ISO-4217 currency code (e.g. "USD"); falls back to intro/trial currency if base is absent.

Link copied to clipboard

true when the offer has a paid finite-recurring (intro) phase.

Link copied to clipboard

Number of billing cycles the intro phase covers, or 0.

Link copied to clipboard

ISO-8601 intro period (e.g. "P1M"), or null.

Link copied to clipboard
val introPhase: ProductDetails.PricingPhase?

Raw intro phase, or null.

Link copied to clipboard

Locale-formatted intro price (e.g. "$1.99"), or null.

Link copied to clipboard

Intro price in micros (price × 1,000,000), or 0.

Link copied to clipboard

true when the offer has a free-trial phase.

Link copied to clipboard

Offer id from Play Console (null when this row represents the base plan itself).

Link copied to clipboard

Free-form tags configured for the offer in Play Console.

Link copied to clipboard

Opaque token passed to com.android.billingclient.api.BillingFlowParams when launching purchase.

Link copied to clipboard
val pricingPhases: List<ProductDetails.PricingPhase>

Raw phase list — use the typed trial* / intro* / base* fields where possible.

Link copied to clipboard

Play product id this offer belongs to.

Link copied to clipboard

ISO-8601 trial duration (e.g. "P7D"), or null.

Link copied to clipboard
val trialPhase: ProductDetails.PricingPhase?

Raw trial phase, or null.