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