Android Purchase subscription and introductory price

*爱你&永不变心* 提交于 2019-12-03 12:25:31

问题


Google came with with the idea of introductory price (https://support.google.com/googleplay/android-developer/answer/140504?hl=en).

My question is related to its API. I can't find the way how to get information about this via Purchases.subscriptions (https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get)

Even when I buy a subscription for introductory price and I asked Google Play Developer API for the information about that subscription, I see only the full price.

Even the inappproduct/get does not have any information about introductory price linked to certain product.

Do you have any idea how to get proper price? Thx


回答1:


I just found this recently at this link https://developer.android.com/google/play/billing/billing_reference.html#billing-codes

Listed in the Billing Details API Reference section, there are extra fields in the response that only appear if there is an introductory price set. introductoryPrice for example gives a string like "$9.99". You can just check if that field is set, and if it is then there is an introductory rate available, you can also get things like the introductory price period and number of cycles it applies to.




回答2:


Finally i used The getPurchaseHistory() method from In-app billing. This method returns the most recent purchase made by the user for each SKU, even if that purchase is expired, canceled, or consumed.

So if the SKU isn't on this return, the intropricing is available.



来源:https://stackoverflow.com/questions/41035514/android-purchase-subscription-and-introductory-price

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!