恢复时,事务状态为SKPaymentTransactionStatePurchased

时间:2015-12-02 04:27:34

标签: objective-c in-app-purchase

每次启动应用程序时,我都会调用还原方法:

[[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"虽然我没有任何新购买。此问题是仅在沙箱中发生还是如何解决?

0 个答案:

没有答案