iphone - 如果 Apple 托管的应用内购买内容下载失败怎么办?
<p><p>有时下载会失败,我的应用会在失败时完成交易,正如在任何地方所推荐的那样。但是,如果我完成交易,那么 Store Kit 将无法恢复失败的下载。而且似乎Store Kit在下载失败后不会自动重试下载内容,而且似乎也没有办法触发下载。</p>
<p>有人知道在这种情况下该怎么做吗?违背所有建议,直到内容完全下载和安装后才完成交易?</p>
<p>或者我必须以编程方式恢复交易并忽略所有其他产品标识符吗?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您可以通过这种方式在您的应用中添加恢复购买按钮:-</p>
<pre><code>//inside of an IBaction
[ addTransactionObserver:self];
[restoreCompletedTransactions];
// Then this is called
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
NSLog(@"%@",queue );
NSLog(@"Restored Transactions are once again in Queue for purchasing %@",);
NSMutableArray *purchasedItemIDs = [ init];
NSLog(@"received restored transactions: %i", queue.transactions.count);
for (SKPaymentTransaction *transaction in queue.transactions) {
NSString *productID = transaction.payment.productIdentifier;
;
NSLog (@"product id is %@" , productID);
// here put an if/then statement to write files based on previously purchased items
// example if (){write files} else { nslog sorry}
}
}
</code></pre>
<p><strong>或</strong></p>
<pre><code> [ restoreCompletedTransactions];
</code></pre>
<p>希望对您有所帮助...!!</p></p>
<p style="font-size: 20px;">关于iphone - 如果 Apple 托管的应用内购买内容下载失败怎么办?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/16788089/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/16788089/
</a>
</p>
页:
[1]