Android-计费5.0.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
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您尝试检索
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 theofferToken
to build the billingFlowParams needed to launch the purchase flow (https://developer.android.com/google/play/billing/migrate-gpblv5#launching-offer).这种行为似乎是正确的。对于每个订阅,当用户有资格查看两者优惠时,您都会获得“优惠”。两者都提供手段,定期订阅(基本计划)和免费试用优惠(免费试用和基本计划)。如果用户以前有这些订阅,他将不会免费试用。
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.
我也面临这个问题。
现在,您可以使用
subscriptionOfferDetails
的第一个值。它具有pripingphactes.pricingphassist
的列表,其中的第一个值将为“自由阶段” , second the the the the全部成本。使用此。
示例:
I also faced this problem.
You can now use the first value of
subscriptionOfferDetails
. And it has a list ofpricingPhases.pricingPhaseList
, in which the first value will be "free period", and the second the full cost.Use this.
Example: