我尚未在应用程序中完成交易,因此当我尝试使用此 ID 购买应用程序内时,我收到此消息:
this in app purchase has already been bought it will be restored for free
但是当我按下“确定”按钮时,委托(delegate)方法从未被调用。
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions{
}
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
}
我如何捕获一些事件来完成此交易?
最佳答案
当用户尝试购买某物时,为什么不首先检查该购买是否已在队列中?
BOOL alreadyInProgress = NO;
for (SKPaymentTransaction *tx in [[SKPaymentQueue defaultQueue] transactions])
{
alreadyInProgress |= [tx.transactionIdentifier isEqualToString:productId];
}
if (alreadyInProgress)
{
// Alert that the purchase is already active
}
else
{
// Your purchase flow
}
关于ios - 使用 SKPayment 未完成交易,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39179750/