A college of mine has implemented iOS in-app purchasing on a auto-renewing monthly basis. I am taking over the code base and want to test it is working. I know the purchasing is wokring but the auto-renewing is what I am worried about.
I have set up a test user and read the Apple documentation that says in sandbox mode, a month is 5 minutes in the sandbox.
However I am not getting any post back from Apple after 5 minutes? should I?
In the AppDelegate I have
inAppPurchase = [TFInAppPurchase new];
[[SKPaymentQueue defaultQueue] addTransactionObserver:inAppPurchase];
[inAppPurchase updateAvailableProductsCache];
I am expecting after 5 minutes, it to fire of a notification or something?
No notification will be generated by apple. You have to save the recipes on server or device by using nsuserdefaults or keychain. you have to track the duration by yourself.By caluclating Compare the product identifier in question to the product identifier of each in-app purchase receipt. If there is a receipt that matches, validation succeeds. Otherwise, validation fails.
When validation succeeds, your application enables the purchased functionality—for example, by downloading content or adding features. When validation fails, your application simply does not enable the functionality.
There is no notification. You keep track of it yourself (the duration). You get a receipt with the original transaction that you save. Use this to verify (perhaps on launch each time) that the user's subscription is still active.
In the iTunes development guide, there's list of how long auto-renew subscriptions last in sandbox mode: