本文介绍了[[SKPaymentQueue defaultQueue] restoreCompletedTransactions] 的取消事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Apple 发布了 StoreKit,当用户输入他/她的电子邮件和密码时,我们甚至无法获得取消事件的任何回调:
Apple released the StoreKit and we cannot even get any callbacks for the cancel event when a user puts in his/her email and password for:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]
此事件不应与 取消购买时推送取消混淆.
我们感兴趣的事件是在尝试恢复交易时推送取消.
用户按下取消,甚至按下 OK 按钮都没有回调.
There are no callbacks for a user pushing cancel, or even pushing the OK button.
您收到的唯一回调是当来自服务器的信息返回指示它是否成功时.不可接受.
The only call back you get is when the information from the server comes back indicating if it was successful or not. Unacceptable.
推荐答案
试试这个:
@protocol SKPaymentTransactionObserver <NSObject>
....
@optional
// Sent when an error is encountered while adding transactions from the user's purchase history back to the queue.
- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
@end
这篇关于[[SKPaymentQueue defaultQueue] restoreCompletedTransactions] 的取消事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!