0

Hello friends i just want to know some couple of questions:

  1. MKStoreKit is good to use for auto renew subscription or does it have any loophole because i am using it for subscribing multiple product for a limited time period using a built in model.?

  2. I am using MKStoreKit to handle autorenewable subscriptions. I'm currently testing a 1 month subscription (in test a subscription lasts 5 minutes). After I purchase the subscription I wait for it to expire. Once it expires I check if the subscription is still active. This returns false like I would expect. However, since it is auto-renewing, I would expect MKStoreKit at that point to contact Apple to revalidate the subscription.

  3. Is it my respossibility to handle auto renew subscription when it expire, i mean to say that i have to implement observer of kSubscriptionsPurchasedNotification notification in my app.

Thanks in advance

4

1 回答 1

2

不久前我也有这个问题。

  1. MKStoreKit 现在不是一个理想的解决方案,因为它不支持 iOS7 和新的 App Receipt 系统。

2-3。Apple文档解释说,他们会在到期前 24 小时更新收据,然后:

订阅成功续订后,Store Kit 将续订事务添加到事务队列中。您的应用程序在启动时检查事务队列并以与任何其他事务相同的方式处理更新。请注意,如果您的应用在订阅更新时已经在运行,则不会调用事务观察器;您的应用会在下次启动时发现续订。

您的应用程序“在启动时检查事务队列”,您需要设置一个SKPaymentTransactionObservervia

[[SKPaymentQueue defaultQueue] addTransactionObserver:yourTransactionObserver];

处理:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

就像您第一次订阅时一样。

在测试时,您可以尝试强制关闭您的应用程序,然后在过期后重新启动它,以查看它是否在启动时成功更新。或者,您可以重新验证您从原始订阅中保存的收据。如果发生续订,验证服务器会返回一个新收据,然后您可以从中获取最近的到期日期。

如果您想查看它,我已将我的自动更新订阅实现放在github上。RMStore是另一个支持 iOS7 的库,也适用于其他类型的购买。

于 2014-01-01T13:03:16.190 回答