自动订阅应用内购买:恢复后续续订 [英] Automatic Subscription In-App Purchases: Restoring Subsequent Renewals

查看:822
本文介绍了自动订阅应用内购买:恢复后续续订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Apple In App Purchase编程指南:

According to the Apple In App Purchase Programming Guide:


App Store每次续订时都会创建一个单独的交易。

The App Store creates a separate transaction each time it renews a subscription. When your application restores previous purchases, Store Kit delivers each transaction to your application.

让我们假设我的应用程式订阅是仅限用户端的应用程式(无服务器组件)。

Let's imagine my app subscription is client-side-only (no server component). The simplest way to verify that subsequent renewals have been billed seems to be restoring previous purchases every month.

,这会弹出用户的iTunes密码提示每次你调用 restoreCompletedTransactions 这似乎很糟糕的用户体验。

However, this pops up the user's iTunes password prompt every time you call restoreCompletedTransactions which seems like bad user experience. Is the only recourse to use the server receipt verification code (along with the new "shared secret")?

推荐答案

App Store是唯一可以使用服务器收据验证码(以及新的共享密钥调用paymentQueue并在每次自动更新时发布事务。该事务发布了transaction.transactionState == SKPaymentTransactionStateRestored。

The App Store calls the paymentQueue and posts a transaction each time it auto-renews. The transaction is posted with transaction.transactionState==SKPaymentTransactionStateRestored.

问题是,不幸的是,这只会发布到一个设备。第二个设备没有发送。因此,要检测自动更新,或者检测缺少自动更新并拒绝任何设备继续订阅,您必须执行restoreCompletedTransaction或http post包含最后一个事务的64位编码JSON。如果fomer,用户需要给他们的密码;和你指出,这是侵入性。如果是后者,则需要大量的附加编码。所以,我的问题在回答你的问题是...为什么StoreKit没有命令:

The issue is that unfortunately this gets posted only to one device. A second device does not get the posting. Therefore, to detect the auto-renewal, or rather to detect the lack of an autorenewal and deny any device a continuing subscription, you have to do a restoreCompletedTransaction or "http post a 64-bit encoded JSON containing the last transaction". If the fomer, the user needs to give their password; and as you point out, that's intrusive. If the latter, lots of additional coding is required. So, my question in answering your question is...why doesn't StoreKit have a command:

(不存在) - [[SKPaymentQueue defaultQueue] restoreAttachedTransactions :( NSArray *)transactions];

(does not exist) - [[SKPaymentQueue defaultQueue] restoreAttachedTransactions:(NSArray *)transactions];

此命令的运行方式与restoreCompletedTransactions相同,但它只会还原附加的事务,最重要的是,它不需要用户登录。它具有与http post一个包含最后一个事务的64位编码的JSON相同的安全保护,它允许整个In App Purchase过程在StoreKit中完成,而不需要web posting代码。

This command would flow just like a restoreCompletedTransactions but it would only restore the attached transactions and, most importantly, it would not require log-in by the user. It has the same security protection as the "http post a 64-bit encoded JSON containing the last transaction" and it allows the entire In App Purchase process to be done in StoreKit rather than requiring web posting code.

如果这对你有意义,请建议如何得到这个苹果....感谢。

If this makes sense to you, please suggest how to get this to Apple....thanks.

这篇关于自动订阅应用内购买:恢复后续续订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆