开发者

How to handle a auto-renewing subscriptions as a developer

In the this Article Apple wrote how to enable an auto-renewing subscription from the users point of view. But my question is how to handle this auto-renewing subscription as the developer of an app?

In my app (currently in developing) the user can buy some subscriptions (30 days, 3 months and 1 year) via in-app-purchase. After a successful payment I send the bought item identifier to my server to save the new subscription time (also used for other开发者_C百科 platforms). This works perfectly in the sandbox-environment.

But if I correctly understand the article the auto-renewing subscriptions is performed from inside the AppStore and inside my app. How can I now track the subscription?


If a subscription is autorenewed, the transaction won't pass the paymentQueue:updateTransactions method. The renew just happens on the Store.

If you want to test for it you have to either:

  • Revalidate the receipt on your application server, if you store the receipt there.
  • Revalidate the receipt on your iOS client

See: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html#//apple_ref/doc/uid/TP40008267-CH104-SW1

In order to avoid testing for an autorenew each launch/activation you should store the endDate of the subscription period to test for a renew afterwards.

Also see: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW4

However, there seems to be a bug in the sandbox. Subscriptions sometimes get renewed, sometimes not. Hard to test....


based on the (rather scant) info found in apple's in-app-purchase documentation, my impression is that whenever you need to determine the state of a user's auto-renewal subscription, you would restore their transactions.

this would cause the app store to send all auto-renewal transactions to your app, at which point you would process the receipts and make the appropriate content available.

presumably, you would only need to do this when the user's current subscription (which you can track locally) is set to expire, or when they are first installing the app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜