Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 264
Joe Shaw Avatar asked Mar 23 '15 19:03

Joe Shaw


People also ask

Can you pay for subscriptions with Google Play?

You can subscribe to these apps with Google Play. When you subscribe: You'll automatically be charged each renewal period depending on your subscription terms, for example: weekly, or annually. If you accept a $0/month trial offer, you'll get an email when your trial is about to end.


1 Answers

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

like image 139
Ashish Garg Avatar answered Oct 20 '22 15:10

Ashish Garg