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.
Related
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
I have subscription feature in my app. Is there any way can I get expiration date of subscribed product without any additional code on the server?
I have searched a lot and didn't get the answer.
Thanks
No, you must send a request to the Google API service specifing the product SKU and the purchaseToken
I would like to let users purchase a good for 3 months for one time.
In subscriptions, even the user can cancel a subscription, since the cancellation of purchases is not possible inside application and the way to cancel a subscription is not straight-forward i think this would return us with a lot of user complaint due to forgotten subscription fees.
Managed product purchases are permanent so they don't work in my case.
Is there a way to make one time purchases with expiry date?
There are no such products out of the box. You have to implement it in your backend. You may use managed product and handle expiration date manually in the app with synchronization with your server.
You may try to hack it without backend comparing purchase date and correct current time (some trusted time server).
I am implementing an app that will have an in-app subscription purchase. The subscription is renewed on a monthly basis. When a user purchases the subscription, they get a free 30 day trial. I understand that I have access to the purchaseDate value from the JSON that is returned, however I have a few questions about this:
When a person's subscription renews, does the purchaseTime / purchaseDate get updated to the date/time of the renewal? Or does it always remain the original purchase date?
I am trying to figure out the best way to cache this locally in the application so as to only have a check using getPurchases a couple of times per month around the time of renewal, are there any good examples or best practices I could follow?
Please don't respond by posting the documentation link. I know where to find that and have read it already :)
The getPurchases() method mentioned here only pulls non-expired purchases. Therefor, if your app notices that a user does not have a purchase (no purchases returned from 'getPurchases()', but they DO have purchase info (has_purchase, purchase_token, etc..) in your app's DB, then you found an expired purchase, so remove all purchase info in the DB for that user.
Hope that helps.
Here is my current guess on this I haven't been able to find a good doc either.
I believe the simple answer is that the purchase date is the original purchase date not the date of the renewal.
In other words if the subscription started on March 1 and you do getPurchases in July the purchase date will still be March 1 even though there have been a few renewals.
You can tell the subscription is active with getPurchaseState() = "0" (Purchased), "1" = Cancelled, "2" = Refunded.
To know the expiration date use the Day of the Month from the Purchase Date and find the next occurence of that Day of the Month. For example if today is July 15th and the getPurchaseState() = "0" then the expiration date must be August 1.
All of the above is a bit of guesswork. I wish I could find a good doc on this too.
the google api documentation states that you should call the method
getPurchases()
to know currently active subscriptions, but is there a way to get from Google the expired subscriptions too? Or should I store the subscription informations on a custom server?
I'm doing a magazine app and, even if the subscription is expired, I should be able to allow the user to re-download the issues published while the subscription was active…
Yes of course there is the way for the android application and your back end server to check your subscription details and it's expiration date and even if have access to cancel subscription manually from your server. Using "purchase-status-api", you can check it's expiration date and auto-recurring bill flag.
AFTER LOT OF SEARCH I GOT FOLLOWING LINKS,
PURCHASE-STATUS-API
AUTHENTICATION DEVELOPER DOC
GET EXPIRATION DATE FOR SUBSCRIPTION PRODUCT
REFERENCE LINKS:
MORE LINKS TO IMPLEMENT GOOGLE API
HELP TO IMPLEMENT FOR SERVER OR CLIENT SIDE GOOGLE API
Hope it will solved your problem.