Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Purchase subscription and introductory price

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

like image 761
Tomas Pavlatka Avatar asked Dec 08 '16 09:12

Tomas Pavlatka


2 Answers

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.

like image 165
Rémy Avatar answered Sep 21 '22 14:09

Rémy


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.

like image 32
JStephen Avatar answered Sep 19 '22 14:09

JStephen