24

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?

Joe Shaw
  • 22,066
  • 16
  • 70
  • 92
  • 1
    Hi - old question :) Did you find the solution? We are currently asking ourselves the exact same question. – adp Mar 07 '17 at 11:50
  • 1
    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 Mar 08 '17 at 14:17
  • Hi ! I have a question for this solution. I have to call [Purchase.subscription get Api](https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get) 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. Thanks – Loint Aug 21 '17 at 09:37

1 Answers1

4

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

Ashish Garg
  • 162
  • 1
  • 11