IAP:接收`paymentQueueRestoreCompletedTransactionsFinished:`回调未完成的事务 [英] IAP: Receives `paymentQueueRestoreCompletedTransactionsFinished:` callback with unfinished transactions

查看:1539
本文介绍了IAP:接收`paymentQueueRestoreCompletedTransactionsFinished:`回调未完成的事务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我会收到此回调

- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue

甚至在我收到此之前

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

I甚至没有说 finishTransaction:。我发现这个超级怪物。我一直假设 paymentQueueRestoreCompletedTransactionsFinished:在我将每个未完成的交易标记为已完成之前不会被触发。

I don't even get to say finishTransaction:. I find this superweird. I've all this time been assuming paymentQueueRestoreCompletedTransactionsFinished: wouldn't be triggered before I had marked every unfinished transaction as finished.

这是预期的行为吗?

这是我在文档中找到的


- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue
*)队列描述

告诉观察者支付队列已完成发送已恢复的事务。在
之后调用此方法所有可恢复的事务都已由付款队列处理。
您的申请不需要在此方法中执行任何操作。

- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue Description Tells the observer that the payment queue has finished sending restored transactions. This method is called after all restorable transactions have been processed by the payment queue. Your application is not required to do anything in this method.

我不确定这意味着什么。

I'm not sure what it means.

推荐答案

我发现头文件本身在这一部分最清楚。

I found the header file itself to be most clear on this part.

@interface SKPaymentQueue : NSObject
...
// Array of unfinished SKPaymentTransactions.  Only valid while the queue has observers.  Updated asynchronously.
@property(nonatomic, readonly) NSArray *transactions;

@end

@protocol SKPaymentTransactionObserver
// Sent when all transactions from the user's purchase history have successfully been added back to the queue.
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
...
@end

这两个结合起来使它明确无误。
paymentQueueRestoreCompletedTransactionsFinished 触发一次 StoreKit 已将所有交易添加到 SKPaymentQueue - [SKPaymentQueue transactions] 只有未完成的交易清单。

These two in conjunction make it unambiguous. paymentQueueRestoreCompletedTransactionsFinished is triggered once StoreKit has added all transactions to SKPaymentQueue. -[SKPaymentQueue transactions] only has a list of unfinished transactions.

我认为文档本可以更明确。

I think the docs could have been more clear about this.

这篇关于IAP:接收`paymentQueueRestoreCompletedTransactionsFinished:`回调未完成的事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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