Android-计费5.0.0-数据结构说明?

发布于 2025-02-09 06:24:29 字数 901 浏览 6 评论 0原文

我对Android计费库的新版本(5)感到困惑。我的应用程序中有一些订阅,每个订阅都有一个月周期和2周的免费试用。现在,我想向用户显示我的订阅的定价详细信息。

当我获得每种订阅的产品详细信息时,总是相同的事情。我在subscriptionOfferDetails列表中获得2个项目,其中第一个具有两个Pricingphase项目,一个具有0个价格(免费试用),另一个具有有效的订阅价格。然后,第二个subscriptionOfferDetails项目一个具有一个定价,带有有效的订阅价格。

那怎么了?为什么Google在这种怪异的结构中返回我的订阅详细信息?为什么我要接收2 subscriptionOfferDetails项目而不是1个?

我应该使用哪个项目来显示适当的订阅价格?另外,当用户想要购买一个时,我应该使用哪一个来启动付款流量?优惠令牌不同。

注意:我的某些国家的价格不同。这是否以某种方式在这里发挥作用?

只是为了澄清

奇怪的是,全价的选项在两个不同的sisscriptionofferdetails项目中两次。图片中的第三个突出显示的项目是没有意义的,因为该选项已经存在于先前的sisscriptionOfferDetails项目中,但具有不同的oftertoken

I'm confused about the new version (5) of android billing library. I have a few subscriptions in my app and each one has a monthly cycle and a 2 weeks free trial. Now I want to show to the users the pricing details for my subscriptions.

And when I get the product details for each subscription it's always the same thing. I get 2 items in the subscriptionOfferDetails list where the first has two PricingPhase items, one with 0 price (free trial) and one with the valid subscription price. And then the second SubscriptionOfferDetails item one has one PricingPhase with the valid subscription price.

So what's up with that? Why is Google returning my subscriptions details in this weird structure? Why do I receive 2 SubscriptionOfferDetails items instead of 1?

Which item should I use to show the proper subscription price ? Also which one should I use to initiate the payment flow when the user wants to buy one? The offer tokens are different.

Note: I have different prices for some countries. Does that somehow come into play here?

JUST TO CLARIFY

The weird thing is that the option with the full price comes two times in two different SubscriptionOfferDetails items. The third highlighted item in the picture is what doesn't make sense because that option is already present in the previous SubscriptionOfferDetails item but with a different offerToken.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半透明的墙 2025-02-16 06:24:30

当您尝试检索subscriptionOfferDetails时,它返回 asl 根据资格标准,用户有资格获得资格。

如果要约有两个定价项目,则意味着它具有自由审判或介绍性定价,然后在自由审判或介绍期完成后定期基本计划定价。

如果用户符合多个报价的资格,则可以在帐单库中使用新的标签功能来检索用户可以购买和使用OfferToken构建所选的要约启动购买流量所需的BillingFlowParams(

When you try to retrieve the subscriptionOfferDetails, it returns all the offers the user is eligible for based on the eligibility criteria.

If an offer has two pricingPhases items, it means that it has a free-trial or intro-offer pricing followed by the regular base plan pricing after the free-trial or intro-offer period has completed.

If the user qualifies for multiple offers, you can use the new tags functionality in the Billing Library v5 to retrieve the chosen offer that the user can buy and use the offerToken to build the billingFlowParams needed to launch the purchase flow (https://developer.android.com/google/play/billing/migrate-gpblv5#launching-offer).

邮友 2025-02-16 06:24:30

这种行为似乎是正确的。对于每个订阅,当用户有资格查看两者优惠时,您都会获得“优惠”。两者都提供手段,定期订阅(基本计划)和免费试用优惠(免费试用和基本计划)。如果用户以前有这些订阅,他将不会免费试用。

That behavior seems to be correct. For each subscription, you get both “offers”, when the user is qualified to see both offers. Both offers means, the regular subscription (base plan) and the free trial offer (free trial and than base plan). If the user had those subscription before, he won’t see the offer with free trial.

初心 2025-02-16 06:24:30

我也面临这个问题。

现在,您可以使用subscriptionOfferDetails的第一个值。它具有pripingphactes.pricingphassist的列表,其中的第一个值将为“自由阶段” second the the the the全部成本
使用此。

示例:

val offerPricesMonth = listSkuDetails[TARIFF_MONTH].subscriptionOfferDetails[0].pricingPhases.pricingPhaseList

// For get free trial
val formattedFreeTrialMonth = offerPricesMonth[0].formattedPrice

// For get cost tariff
val formattedPriceMonth = offerPricesMonth[offerPricesMonth.lastIndex].formattedPrice

I also faced this problem.

You can now use the first value of subscriptionOfferDetails. And it has a list of pricingPhases.pricingPhaseList, in which the first value will be "free period", and the second the full cost.
Use this.

Example:

val offerPricesMonth = listSkuDetails[TARIFF_MONTH].subscriptionOfferDetails[0].pricingPhases.pricingPhaseList

// For get free trial
val formattedFreeTrialMonth = offerPricesMonth[0].formattedPrice

// For get cost tariff
val formattedPriceMonth = offerPricesMonth[offerPricesMonth.lastIndex].formattedPrice
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文