23
votes

When a user first purchases a subscription from the Google Play Store, my app sends my server a receipt which contains the package name, the subscription/product ID, and the purchase token. I can then call the Purchases.subscriptions.get API to verify the subscription.

What I am unclear about is whether I can verify the subscription entirely server side once a renewal happens? The docs are pretty unclear about this.

As I understand it, with the V3 purchases API the app needs to poll to see if a subscription has been renewed and then forward the new receipt onto the server. I assume the purchase token would be different across renewals, which would suggest that it's not possible to implement renewal checks entirely server-side.

Am I missing anything?

1
Hi - old question :) Did you find the solution? We are currently asking ourselves the exact same question.adp
It's been a while, but if I recall correctly the product ID and original purchase token are sufficient to get the current state of an auto-renewing subscription.Joe Shaw
Excellent. Thanks 👍🏼adp
Hi ! I have a question for this solution. I have to call Purchase.subscription get Api to know what subsciption expire or renewal?. So I have to create a cronjob task to get status of subscription of each user? I am unclear workfollow of this solution . Please explain more detail. ThanksLoint

1 Answers

4
votes

You can check client side for after every fix interval of time for auto renewal or renew subscription by using https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get and check for validity for subscription in response https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#resource you get following and notify your server for subscription state after every firx interval or only when you get autoRenewing or you get changed expiry date