用户输入凭据进行In App Purchase后,是否可以收到消息?

时间:2012-09-12 01:54:03

标签: ios in-app-purchase

我希望收到一条消息,以便在应用与App Store通信时显示“正在处理...”覆盖,以完成In App Purchase。是否只有在用户输入凭据后才会触发回调,以便我不会在UIAlertView后面显示“正在处理...”?

1 个答案:

答案 0 :(得分:0)

事实证明这有一个回调,我只是错过了它。每当交易状态发生变化时,SKPaymentTransactionObserver的方法paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions都会被调用,包括何时更改为SKPaymentTransactionStatePurchasing,因此您可以执行以下操作:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
    if (transaction.transactionState == SKPaymentTransactionStatePurchasing) {
        // do your stuff
    }
}