ios - 购买产品时的应用内购买问题
<p><p>点击按钮后,我正在应用内购买
(多次显示我的测试用户的登录警报)</p>
<pre><code>- (IBAction)BuyProduct:(id)sender {
SKPayment *payment = ;
[ addPayment:payment];
}
</code></pre>
<p>然后代码移动到</p>
<pre><code>case SKPaymentTransactionStateFailed:NSLog(@"Transaction Failed");
[ finishTransaction:transaction];
</code></pre>
<p>最后我的控制台显示:</p>
<pre><code>2013-12-06 18:56:13.694 sample_purchase Transaction Failed
2013-12-06 18:56:20.553 sample_purchase <SKPaymentQueue: 0x166809c0>: Ignoring restoreCompletedTransactionsWithApplicationUsername: because already restoring transactions
2013-12-06 18:56:21.844 sample_purchase <SKPaymentQueue: 0x166809c0>: Ignoring restoreCompletedTransactionsWithApplicationUsername: because already restoring transactions
</code></pre>
<p>请帮忙!</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>这可能对你有用:</p>
<pre><code>- (void)restoreCompletedTransactions {
if ([[ transactions] count]) {
NSLog(@"We get very non-patient user");
for (SKPaymentTransaction *transaction in [ transactions])
[ finishTransaction:transaction];
}else{
[ restoreCompletedTransactions];
}
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 购买产品时的应用内购买问题,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/20425485/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/20425485/
</a>
</p>
页:
[1]