每次启动应用程序时,我都会调用还原方法:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
我检查事件中的事务状态更改:
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
for (SKPaymentTransaction *transaction in transactions) {
switch (transaction.transactionState) {
case SKPaymentTransactionStatePurchased:
NSLog (@"SKPaymentTransactionStatePurchased");
break;
case SKPaymentTransactionStateFailed:
NSLog (@"SKPaymentTransactionStateFailed");
break;
case SKPaymentTransactionStateRestored:
NSLog (@"SKPaymentTransactionStateRestored");
break;
default:
break;
}
}
}
问题是,日志总是显示" SKPaymentTransactionStateRestored"虽然我没有任何新购买。此问题是仅在沙箱中发生还是如何解决?