Ashwin
Ashwin

Reputation: 13517

How to find the end time of a subscription?

Android billing library has the queryPurchasesAsync api which returns the puchases of the user. Purchase class has the method getPurchaseTime() but the document says that for a subscription this accounts to the first time the subscription was purchased not the last renewal time.

How can I know the last time the renewal occured? Or better how can I know the end time of the subscription (from the last renewal)?

Upvotes: 0

Views: 40

Answers (1)

Michal Rymarski
Michal Rymarski

Reputation: 41

You need to implement a backend to get the expiry date of a subscription. Just like the docs say https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions . But Google play checks if subs are active ,even when you're not using your app. It updates the data when you're online and caches it, so your app can grab it as a Purchase even when a user is using your app while offline.

Upvotes: 1

Related Questions