简体   繁体   中英

How to check subscription state in Android billing?

I have some app, which have subscription. User can buy subs, but how I can check is subs currently active (without server validation)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM