iOS sandbox environment auto-renewal subscription

跟風遠走 提交于 2019-11-29 19:38:50

a) Auto-renewing subscriptions are inconsistent in the sandbox environment. Sometimes a subscription will renew multiple times (about 5) before ending. Other times it won't renew at all.

b) (iOS6 transaction receipts only) You don't need to call restoreCompletedTransactions to check the status of a subscription if you're storing previous receipts (preferably on your server). Just take any subscription receipt you've stored for that user and submit it to the App Store for verification. They'll respond with the latest_receipt_info including the expires_date which you can use to determine current subscription status.

c) You should prompt new users to "Restore Previous Purchases" at which point you call restoreCompletedTransactions. Then submit one of those receipts (preferably from your server) to the App Store for verification to get decoded details about the transaction. Look for the key original_transaction_id in the receipt info. This will always contain the id of the very first time this user initiated a subscription with you. If you compare this ID to others in your system, you should be able to determine which devices share an Apple account. (Since Apple doesn't allow you to see a user's Apple ID, this is the best way to identify an account that spans multiple devices).

Similar to this question: iOS auto-renew expired at the end of current subscription period

To add to this it seems that the line in Apple's documentation is being misinterpreted

Renewal happens at an accelerated rate, and auto-renewable subscriptions renew a maximum of six times per day. This lets you test how your app handles a subscription renewal, a subscription lapse, and a subscription history that includes gaps.

This seems to mean that all subscriptions per day will only renew 6 times. Rather than each subscription will renew 6 times before canceling. This threw me for a while.

It also seems to be in a 24 hour period. Not refreshing at a given time. For example, I made a subscription at 11am that did not renew. I made one again at 2pm that renewed 6 times.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!