Detecting whether the current subscription is in Trial for Google Play store?
Asked Answered
B

2

14

I'm trying to detect whether a user who has purchased my application through in-app purchase is in currently in Trial period or not.

For Apple (ios store) it was an easy flag which I could find in the receipt.

For Google Play, even though I'm making a server end call using the google play android developer API but the response itself does not contain any flags for me to understand whether the user is currently in paid or trial period.

Does any one have any smart suggestions of how to detect this in the google world?

Basifixed answered 25/6, 2014 at 5:2 Comment(1)
I am also looking for this? Have you found anything in the mean time? It looks like it is not offered in V2..Intoxicant
I
3

Actually it seems like this really ins't offered by V2 at the moment. The best alterantive that I have though of so far would be to keep track of the first time this purchase was made (e.g. reading it our from the first receipt that the user received for the purchase) and then comparing this timestamp to the current time using the duration of the trial period.

This can be read from trialPeriodof the InAppProducts.get part for the respective productId.

https://developers.google.com/android-publisher/api-ref/inappproducts

If anyone has a better solution, I would be happy to read it here.

Intoxicant answered 15/9, 2014 at 10:2 Comment(0)
D
2

I checked the difference between initiationTimestampMsec and validUntilTimestampMsec. If it matches my configured trial period its trial.

Dermott answered 8/8, 2014 at 14:33 Comment(1)
This refers to the V1 of the API, right? I don't think that they supported trials there, did they? And if so, which value would then hold the start of the the current billing period?Intoxicant

© 2022 - 2024 — McMap. All rights reserved.