Based on the documentation you can call getOneTimePurchaseOfferDetails()
on ProductDetails to return a ProductDetails.OneTimePurchaseOfferDetails
object, which has a getFormattedPrice()
method to return the price for in-app purchases.
For subscriptions you can call getSubscriptionOfferDetails()
which returns a list of ProductDetails.SubscriptionOfferDetails
objects, which have a getPricingPhases()
method to return different pricing phases. The pricing phase objects have a getFormattedPrice()
method to get the price from.
UPDATE
To better explain what this new approach allows, you can now create multiple "base plans" for a given subscription product. For example, you could create an "unlimited" product, then create an "unlimited-annual" plan for $50/year and an "unlimited-monthly" plan for $5/month.
The ProductDetails
returned for a configuration like that would look like this - where you have a single productId
with multiple payment rates/plans. If you add a promotion (e.g. discount for the first year) that shows up with a non-null offerId
under an existing base plan ID.
{
productId: "unlimited",
subscriptionOfferDetails:
[
{
basePlanId: "unlimited-monthly",
offerId: null,
pricingPhases:
[
{formattedPrice: "$5", billingPeriod: P1M, recurrence: 1}
]
},
{
basePlanId: "unlimited-annual",
offerId: null,
pricingPhases:
[
{formattedPrice: "$50", billingPeriod: P1Y, recurrence: 1}
]
},
{
basePlanId: "unlimited-annual",
offerId: "unlimited-annual-promotion",
pricingPhases:
[
{formattedPrice: "$30", billingPeriod: P1Y, recurrence: 2}
{formattedPrice: "$50", billingPeriod: P1Y, recurrence: 1}
]
}
],
oneTimePurchaseOfferDetails: null
}
There are also details from Google here about the new format.