Retrieve Google Play In-App Subscription Expiration Date

The implementation of the new product for subscribing to the application for Android applications seems identical to regular managed / unmanaged products, but (afaik) getting the expiration date of the subscription is available only through the Google Play Android Develope HTTP API. This part of me is wordless.

Any implementation examples using the Google API Java client APIs to get an expiration date would be a huge help.

+6
source share
1 answer

Well, you can always calculate the expiration date using AIDL for subscription. If you request RESTORE_TRANSACTIONS (if you do not have previous local data), you will receive the purchase date and current subscription status and a couple of other data. If you have a monthly subscription, and you are far beyond the first month, you need to check the current status (which can be automatic using receivers for PURCHASE_STATE_CHANGE clicks in the Play Store). Knowing the condition and date of purchase, you can calculate the validity period.

+1
source

Source: https://habr.com/ru/post/917042/


All Articles