ios - 使用 SKPayment 未完成交易
<p><p>我尚未在我的应用中完成交易,所以当我尝试使用此 ID 在应用内购买时,我收到了以下消息:</p>
<blockquote>
<p>this in app purchase has already been bought it will be restored for
free</p>
</blockquote>
<p>但是当我按下确定按钮时,委托(delegate)方法从未被调用。 </p>
<pre><code>- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions{
}
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
}
</code></pre>
<p>我怎样才能捕捉到一些事件来完成这个交易?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>当用户尝试购买某物时,为什么不先检查一下该购买是否已经在队列中?</p>
<pre><code>BOOL alreadyInProgress = NO;
for (SKPaymentTransaction *tx in [ transactions])
{
alreadyInProgress |= ;
}
if (alreadyInProgress)
{
// Alert that the purchase is already active
}
else
{
// Your purchase flow
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 使用 SKPayment 未完成交易,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/39179750/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/39179750/
</a>
</p>
页:
[1]