I have some app, which have subscription. User can buy subs, but how I can check is subs currently active (without server validation)?
Asked
Active
Viewed 1,805 times
0
-
Can you provide code examples of what you've tried or specific errors you're facing? – enc_life May 20 '19 at 17:49
-
@enc_life yeah [here](https://gist.github.com/dimmells/3a22c67cbde9ac4f6d21281b00888ae8) – Dmytro Melnyk May 21 '19 at 11:02
1 Answers
2
You can call queryPurchases() API if you're using the Google Play Billing Library. https://developer.android.com/reference/com/android/billingclient/api/BillingClient#querypurchases
If the subscription item is still active, it will be returned by this API. Once it gets non-active, Google Play will revoke it from client and thus it won't be returned by this API.

DrPower
- 445
- 3
- 6
-
2Any idea why while in test, a subscription is still being returned after an hour (should have expired after 5 min - monthly) – justdan0227 May 22 '20 at 15:17
-