问题描述
我可以成功地从苹果服务器购买和下载内容,并使用它。
我的应用内购买内容不可消耗。所以我在我的应用程序中提供还原按钮
现在当用户按恢复按钮时,我调用方法:
restoreCompletedTransactions
但在这里,我没有收到通话委托方法:
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)交易
所以我可以识别交易对象,并从苹果服务器重新开始下载内容。有人可以帮我写恢复选项?
根据苹果,它说:
//异步。将当前用户的完成事务添加回队列以重新完成。用户将被要求验证。观察者将收到0个或更多的-paymentQueue:updatedTransactions :,其次是-paymentQueueRestoreCompletedTransactionsFinished:on success或-paymentQueue:restoreCompletedTransactionsFailedWithError:on failure。在部分成功的情况下,一些交易可能仍然可以交付。
但是对于我来说,我没有收到paymentQueue:updatedTransactions所有。我刚刚收到paymentQueueRestoreCompletedTransactionsFinished:的消息。
你可能没有观察到事务队列。确保你有
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];在您调用restoreCompletedTransactions方法之前,
I'm able to successfully make the inapp purchase and download the content from Apple server and use it.
My In app purchase content is non-consumable. And so I'm providing "Restore" button in my app
Now when user presses "Restore" button, I'm calling the method:
restoreCompletedTransactions
But here, I'm not getting the call to delegate method:
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
So that I can identify the transaction object and start downloading the content again from apple server. Can some one help me in writing "restore" option?
As per apple, it says:
// Asynchronous. Will add completed transactions for the current user back to the queue to be re-completed. User will be asked to authenticate. Observers will receive 0 or more -paymentQueue:updatedTransactions:, followed by either -paymentQueueRestoreCompletedTransactionsFinished: on success or -paymentQueue:restoreCompletedTransactionsFailedWithError: on failure. In the case of partial success, some transactions may still be delivered.
But for me, I'm not getting the call "paymentQueue:updatedTransactions" at all. I'm just getting the call "paymentQueueRestoreCompletedTransactionsFinished:"
You probably do not observe transaction queue. Make sure you have
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
somewhere before you call restoreCompletedTransactions method
这篇关于iOS6 - 从Apple服务器下载的应用程序购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!