自动续订订阅在自动续订时会发送 SKPaymentTransactionStatePurchased 交易吗? [英] Do auto-renewable subscriptions send an SKPaymentTransactionStatePurchased transaction when they auto-renew?

查看:23
本文介绍了自动续订订阅在自动续订时会发送 SKPaymentTransactionStatePurchased 交易吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AppStore 是否在自动续订自动续订订阅时发出交易?如果是这样,如果应用程序将自己设置为观察者,应用程序下次加载时能否可靠地检测到它:

Does the AppStore send out a transaction when it auto-renews an auto-renewable subscription? If so, can it reliably be detected by an App the next time the App loads if it sets itself as an observer:

[[SKPaymentQueue defaultQueue] addTransactionObserver:self];

新的自动续订交易是否会调用:

Will the new auto-renewed transaction make a call to:

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

使用 transaction.transactionState==SKPaymentTransactionStatePurchased?

with transaction.transactionState==SKPaymentTransactionStatePurchased?

如果是这样,那太好了.如果不是,这是否意味着您必须在每次自动续订订阅接近到期时检查所有交易:

If so, great. If not, does this mean you must examine all transactions every time an auto-renewable subscription approaches expiration using:

 [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; 

谢谢...

推荐答案

经过一些研究,我可以回答我自己的问题并提出另一个相关问题.App Store 调用支付队列并发布交易.交易通过 transaction.transactionState==SKPaymentTransactionStateRestored 发布,不是 transaction.transactionState==SKPaymentTransactionStatePurchased.

After some research I can answer my own question and raise another related issue. The App Store calls the paymentQueue and posts a transaction. The transaction is posted with transaction.transactionState==SKPaymentTransactionStateRestored, not transaction.transactionState==SKPaymentTransactionStatePurchased.

问题是不幸的是,这只会发布到一台设备上.第二个设备没有得到该张贴.因此,要检测自动续订,或者更确切地说是检测缺少自动续订并拒绝设备继续订阅,您必须执行 restoreCompletedTransaction 或http 发布包含最后一笔交易的 64 位编码 JSON".如果是前者,用户需要提供自己的密码;那是侵入性的.如果是后者,则需要大量额外的编码.所以,我的问题是……为什么 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 the 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; that's intrusive. If the latter, lots of additional coding is required. So, my question is...why doesn't StoreKit have a command:

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

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

这个命令的流程就像一个 restoreCompletedtTransactions 但它只会恢复附加的交易,最重要的是,它不需要用户登录.它具有与http 发布包含最后一笔交易的 64 位编码 JSON"相同的安全保护,并且允许整个应用内购买过程在 StoreKit 中完成,而不需要网络发布代码.

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.

如果这对您有意义,请建议如何将其发送给 Apple....谢谢.

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

这篇关于自动续订订阅在自动续订时会发送 SKPaymentTransactionStatePurchased 交易吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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