处理 iPhone 上的应用内购买(或恢复购买)时显示进度指示器
如何在 iPhone 上处理应用内购买过程中显示进度指示器?我知道如何显示进度/活动指示器本身,但我需要知道何时启动它。如果我在调用方法后立即启动它,
[[SKPaymentQueue defaultQueue] addPayment:payment];
当用户出现 iTunes 帐户密码提示时,我将看到该指示器。我想在这个提示已经通过后开始进度。另外,恢复已完成的交易也是如此:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
我尝试将指示器连接到 SKPaymentTransactionStatePurchasing 状态
paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
,但仍然在密码提示之前启动它。有什么建议吗?
How do I show a progress indicator during processing of in-app purchase on iPhone? I know how to display progress/activity indicator itself, but I need to know when to start it. If I start it right after calling
[[SKPaymentQueue defaultQueue] addPayment:payment];
method I will see the indicator when user is presented with iTunes account password prompt. I would like to start the progress when this prompt has been already passed. Also, the same thing for restoring completed transactions:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
I tried to hook up the indicator to SKPaymentTransactionStatePurchasing state within
paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
but still get it started before the password prompt. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为交易有进展通知。我为 IAP 所做的就是抛出一个旋转器。唯一可以真正显示进度的情况是购买包含下载,您可以从中自行跟踪下载进度。
I do not believe that there is a progress notification for the transaction. What I do for IAP is to throw up a spinner. The only time you can really display progress is if the purchase includes a download, from which you can track download progress on your own.