Search code examples
objective-ciosin-app-purchasesandboxstorekit

SKPaymentTransaction expires_date,seems like "auto renew" mechanism doesn't work in the sandbox


I've almost managed Auto renewable subscription in my app, but one strange thing occures - it doesn't auto renews.

I have a button, which adds an SKPayment with my product and it gives me receit with it's SKPaymentTransaction, that is really active.

Than i save that receipt and try to send it to Apple again to check the expire date.And it returns me the date of my first purchase, not the last one, in it's expiredate.And when the subscription period ends(in five minutes in sandbox), it just returns me 21002

But if i manually renew it again, the new receipts gives me updated expire date, i save it again, and everything goes round.

And, yes, original_purchase_date is the same in both of this receites.

MAybe i just don't understand, how checking of expire date works?


Solution

  • If you want to save a few hours of your life, here's the key that i've spent a few hours (not literaly) to find out:

    Auto renew STOPS after some period in Sandbox

    Some people say that it happens after 6 times(30 minutes for a montky subscription),and then you begin to get 21006's, you have to repuchase it again then, and,even after repurchase, it wouldn't auto renew anymore-you have to create a new test user to test that part of in-app again. 

    I felt it myself, and guys in apple forums say they experinced the same problem.

    https://devforums.apple.com/thread/105350

    Actually, i searched a bit more,and found out in in Apples iTunes Connect Developers Guide, but i didn't read it before,so it brought me so much headache.