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

前端 未结 2 500
我寻月下人不归
我寻月下人不归 2021-01-11 14:36

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

相关标签:
2条回答
  • 2021-01-11 15:00

    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.

    0 讨论(0)
  • 2021-01-11 15:04

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

    0 讨论(0)
提交回复
热议问题