OfferInfo
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 trial —
priceAmountMicros == 0,RecurrenceMode.FINITE_RECURRINGintroductory —
priceAmountMicros > 0,RecurrenceMode.FINITE_RECURRINGbase —
RecurrenceMode.INFINITE_RECURRING
Use AppPurchase.getOffers, AppPurchase.getTrialOffer, or AppPurchase.getBaseOffer to obtain instances — do not construct directly.
Since
3.5.7
Constructors
Properties
Base plan id from Play Console (null on legacy or simple offers).
Base price in micros, or 0.
ISO-8601 base billing cycle (e.g. "P1M", "P1Y"), or null.
billingPeriod parsed into components, or null when absent/unparseable. Use BillingPeriod.unit and BillingPeriod.count to render a localized label such as "per month".
ISO-4217 currency code (e.g. "USD"); falls back to intro/trial currency if base is absent.
Locale-formatted counterpart of firstCyclePriceMicros — the trial phase's formatted price (usually a localized "Free"), the intro price, or the base price. Empty when no phase is available.
The price the user actually pays for the first billing cycle, in micros: 0 during a free trial, the intro price when one applies, otherwise the base price. Use this to render the "you pay now" line of a paywall.
true when the offer has a paid finite-recurring (intro) phase.
true when this offer carries any promotional phase (trial or intro price). The inverse of isBaseOffer.
Number of payments the user commits to when first purchasing an installments plan, or 0 when this is not an installments plan.
Installment plan details when this base plan is a Play installments subscription, or null for standard auto-renewing plans.
Number of payments the user commits to on each renewal of an installments plan, or 0 when this is not an installments plan.
Number of billing cycles the intro phase covers, or 0.
Whole-percent discount of the introductory price against the recurring price, normalized per month so a "3 months for the price of 1" offer scores correctly against a monthly base.
ISO-8601 intro period (e.g. "P1M"), or null.
introPeriod parsed into components, or null when this offer has no intro phase. Note this is the length of a single intro cycle — multiply by introCycleCount for the full promotional window, or use introTotalDays.
Raw intro phase, or null.
Locale-formatted intro price (e.g. "$1.99"), or null.
Intro price in micros (price × 1,000,000), or 0.
Total length of the introductory window in days — one intro cycle multiplied by introCycleCount. Returns 0 when there is no intro phase.
true when this offer has no promotional phase — neither a free trial nor an introductory price — i.e. the user pays the recurring price from day one.
true when the offer has a free-trial phase.
true when this offer is an installments base plan — the user commits to a number of payments up front. See installmentCommitmentPayments.
Opaque token passed to com.android.billingclient.api.BillingFlowParams when launching purchase.
Recurring price normalized to one average month, in micros. Lets a paywall compare a yearly plan against a monthly one on equal terms, and render "only $4.16/month, billed yearly".
Recurring price normalized to one week, in micros. Returns 0 when the base price or billing period is unavailable.
Raw phase list — use the typed trial* / intro* / base* fields where possible.
ISO-8601 trial duration (e.g. "P7D"), or null.
trialPeriod parsed into components, or null when this offer has no trial.
Raw trial phase, or null.
Functions
true when this offer carries the given Play Console offer tag. Tags are the supported way to mark an offer for a specific paywall slot (e.g. tag "popular" and look it up with AppPurchase.getOffersByTag).