3
    if (transaction.transactionState == SKPaymentTransactionStateRestored) {
    }
    else if(transaction.transactionState == SKPaymentTransactionStatePurchased){
    }

Apple alert 为“您已经购买了此商品,点击确定下载”但未调用 SKPaymentTransactionStateRestored,状态仍为“SKPaymentTransactionStatePurchased”,因此这些代码不起作用。

我认为“originalTransaction”也许可以帮助我,下面是我的代码:

    SKPaymentTransaction *trans = transaction.originalTransaction;

    if (trans) {
        // restored transaction
    }
    else{
        // not restored transaction, purchased?
    }

这些代码可靠吗?谢谢。

4

0 回答 0