Say a user purchases a auto-renewing one-month subscription. When can I re-verify the receipt that I'll get a new receipt for the renewed subscription. Do I have to wait exactly 31 days from the time of purchase? Or is 30 days enough?
You can verify whenever you like and as often as you like. If it's after a renewal has happened you'll get the new receipt in the response. Otherwise you'll just get the receipt from the existing period.
Related
let say I purchase one month auto renewable subscription. I use product for 3 month, in 3rd month I cancel subscription. Now my question is can I get receipt for last two month transaction?
The concept of receipt when working with iap is not the same as the general concept of receipts. You don't get a new receipt for each transaction. Your app only has one receipt. Each time you auto renewable subscription renews your app receipt will get updated with a new transaction.
The receipt for an application or in-app purchase is a record of the
sale of the application and of any in-app purchases made from within
the application.
I am facing issues with my auto-renewing subscription for an iOS app that offers auto-renewable subscription.
The Subscription Status URL is at times, not being called when the subscription is renewed. This is making it difficult for us to track the user's subscription status. Funnily, this behaviour is completely arbitrary at times it is called and everything works smoothly, but at times it is not called at all.
Also, once the user's subscription is renewed, at times the user is not charged on his/her credit card instantly. Is this behaviour normal?
You have to follow basic rules for subscription based application.
Whenever you buy any auto renew subscription, in success verify your receipt and verify expiry date.
On every application launch very receipt and verify subscription. On depending result you can notify your server.
In sandbox environment for monthly subscription it will auto renew for every 5 mins. It will auto renew for 5 times. So you can check your test cases. After that it will be expire.
In real world case subscription will auto renew before 24 hours of renew date. So if user cancels subscription before that.
If you are using SwiftyStorekit than it will be very much easy for you to handle each and every steps. Let me know you if you want more coding approach in this case.I will share example code details if you want.
The Subscription Notifications are pretty unreliable and the descriptions of how they work aren't very clear. For example:
RENEWAL events aren’t sent when a subscription renews. ... RENEWAL
is sent when a subscription has expired, then later, the user starts
the subscription again.
CANCEL does not mean a user normally cancelled their subscription. It only is sent when a user cancels their subscription via customer
support. This is also known colloquially as a refund.
Source: RevenueCat (Disclaimer: I work there)
I have implemented auto renewable subscription (Monthly and Yearly Renewal).I have purchased successfully and verified the receipt. But I don't know how to verify the recipet when subscription auto renewed.(Successfully OR failed). SO please help
There are two approaches. First, your app get notified, when subscription is renewed, actually new purchased transaction received, and you should resend receipt to your server or locally on device set proper configuration. Second, in apple response of receipt validation there is a field "latest_receipt_info", you can retry receipt validation on server in the end of period of subscription and get actual info about your subscription (for instance, if client can't send receipt for some reasons). Combined approach is the best way.
I want to create a trial period ( 1 week) on my 1 month AR subscription in App purchase application via iTunes Connect. The question is, how to test it in sandbox and have the accurate information in Apple receipts that indicates the differenciation of status between the trial time period and the paying subscription?
Thanks!
For in-app products with Free Trials, StoreKit on the client side issues two iOS7 style receipts in the in_app section -
When the user hits Buy which starts the free trial. User is not charged at this time. The receipt sent to the server for verification will have :
expires_date_ms - purchase_date_ms = Number of Free trial days.
When the free trial days are up and if the user has not turned OFF autorenewal from Manage subscription screen, another receipt is issued and this time the user is charged. The receipt issued will have
expires_date_ms - purchase_date_ms = Term Length
If the user has turned off autorenewal before the free trial expires, the server should detect this and turn off the subscription for the user.
I did trial payment in production account and got receipt from appstore. This receipt included field "is_trial_period" as "true". But after trial period I get receipt with real bill and it does not have trial fields.
I am writing logic as:
If receipt have "is_trial_period" field after validation and it true - it is trial receipt
If receipt fields "original_transaction_id" != "transaction_id" - it is real bill, I am finding original transaction in my own DB and renew it.
But appstore documentation does not have same trial field information. Sandbox does not this field to.
First you need to create a test user from your iTunes account and register your app for in app purchase. Then you can use your that test user for purchase the subscription. Here apple had provided some facility like your 1 month subscription will be equivalent to 5 minutes and 3 equals to 15 minutes approx and so on. Also if you are using it as auto renewable in app purchase it will renew for 3 to 4 times not fixed as I tested.
When there is an auto-renewing subscription, consider the following model situation:
user buys 1 month subscription, lets say in January
cancels renewal
then waits until March (>1 month) and buys same subscription again
Does the AppStore return (on receipt verification) a new original_transaction_id for the new purchase? Or rephrased, can original_transaction_id be used for grouping receipts to determine intervals when user had active subscription?
Because in sandbox, when there is a simulated situation like this, it returns always original_transaction_id from the FIRST purchase of given subscription, regardless if there were some intervals where user had not active subscription. When there was multiple purchases of subscription with intervals between, when it was expired, Sandbox receipt verification returns original_purchase_date of first purchase, and expires_date of last purchase.
My problem is, to test it in live enviroment, I would have to wait more than a month to let subscriptions expire to test the exact behaviour.
I have maintained an production app with subscription for several years.
As far as I see, original_transaction_id does not change in that case you mentioned.
Moreover, original_transaction_id belongs to subscription group, not each product_id.
So it remains same in below cases.
User start subscription, stop auto-renew and expire, then start subscription again.
User start subscription and cancel it, but start again.
User start subscription and upgrade or downgrade to subscription in same group.
But this is not a guaranteed result, so you would better prepare in case original_transaction_id changes.