Can I validate Google Play in-app subscription renewals completely server-side?
Asked Answered
C

1

23

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?

Cajole answered 23/3, 2015 at 19:42 Comment(3)
Hi - old question :) Did you find the solution? We are currently asking ourselves the exact same question.Karee
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.Cajole
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. ThanksPteridology
M
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

Mize answered 27/4, 2017 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.