简体   繁体   中英

How to check if a user has a subscription (Android in-app billing)?

I've been trying to use the Google Play Android Developer API but just realized that that might not be what I should be doing:

Your servers should never query subscription status dynamically, based on individual requests from your Android application. - Google

I don't have my own servers and don't anticipate over 15000 daily app uses (the API allows 15000 requests per day), and was just planning on checking the subscription state every time the app is started up.

This seems to be what Google is saying I should not be doing. So, how can I check a user's subscription state otherwise?

I believe the answer is a couple of paragraphs above in the same document :

  • Store subscription expiry on your servers

  • Cache expiration and purchaseState

  • Query for subscription status only at expiration

Generally, what they are saying is that you should cache the state of subscription and don't query it each time.

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