How to get Expiry date of Subscription in In-App-Purchase v5 - android

How to get Expiry date of Subscription in In-App-Purchase v5
i have implemented In App Subscription with V5 Billing Library
I m getting PurchaseTime but i want to get Expiry date to update to my server.
val details=billing.getPurchaseWithProductName(productsList[0])
if (details!=null){
**details.purchaseTime**
}

Related

Android - Play Store - Change expiration date of a subscription

I want to change the expiration date of a Subscription in my Play Store using the Play Store API.
I have a Mobile App where you can buy a renewal Play Store Subscription or you can get some time for free from Promos in app.
The main problem here is that if you have bought a subscription from the Play Store and you want to add time by a Promo in the application, I can't change the Renewal date of your subscription to handle this new time added into your Premium. So, the Play Store is going to renew your subscription and take the payment in a wrong date.
How can I handle this situation??
iOS CASE: iOS - App Store - Change expiration date of a subscription
The solution for this problem, is use Defer.
With this we can modify the next billing date, and move it to the future the days we need.
Documentation
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/defer

manual renewal for android inapp subscriptions before expiry date

According to the billing subscriptions documentation, there is a possibility of triggering a manual renewal before the current subscriptions has expired.
For eg. If I invoke the same purchase flow on a particular monthly sub 2 times in a row, the second one will fail with the error 'You have already subscribed to xxx'. I am expecting it to succeed and add an additional month to the expiry date.
Is there a way of manually renewing IAP before the expiry date?
the manual renewal will happen with subscription recovery.

Get Expired day of Subcription when using IAB in Android

I'm making an app with buy some subscriptions. I want to get Expired day of Subscription, when I finish buying a subscription. But I haven't gotten Expired Day. Help me get Expired Day of Subscription!

How long is a month/year in an Android monthly/yearly subscriptions

I'm working on an Android application, where a user can buy a monthly/yearly subscription to unlock content. Since the app is not very dependant on the internet I try to do as less comunication with backend servers as possible. However, I have to check if the user holds a valid subscription.
So my plan is to let the user buy the subscription and set the expiry date to today + 1 month/year.
As long as the current date is before this expiry date, I do not need to check the subscription anymore. But once the current date is after this expiry date, I need to check again if the subscription is still there. If so I need to update the expiry date by another month/year.
But how long is a month/year for Google? A month can be between 28 and 31 days long. A year between 365 and 366 days.
As per the documentation:
Monthly — Google Play bills the customer’s Google Wallet account at the time of purchase and monthly subsequent to the purchase date (exact billing intervals can vary slightly over time).
Annually — Google Play bills the customer's Google Wallet account at the time of purchase and again on the same date in subsequent years.
Seasonal — Google Play bills the customer's Google Wallet account at the beginning of each "season" (you specify the season beginning and end dates). This is intended for annual purchases of seasonal content (such as sports-related content). The subscription runs through the end of the season, and restarts the next year at the start of the season.
So for monthly subscriptions, it renews when the date number matches the purchase date (not sure what it does if you start on the 31st though) and for yearly it just renews on the same day the following year.

in app billing: How to find expiration date of user subscription

I am adding a subscription feature to my app. Is there any way I can know the expiry date of the current subscription?
I searched everywhere and cant seem to find the answer
Thanks you
Getting the expiration date for subscriptions is only available through the Google Play Android Develop HTTP-based API. You can always calculate the expiration date using theAIDL for subscriptions. If you request RESTORE_TRANSACTIONS (assuming you have no previous local data) you'll get the purchase date and the current state of the the subscription and a couple of other data.

Categories

Resources