内购与服务器通信时如何管理界面?

发布于 2024-10-01 02:29:06 字数 192 浏览 2 评论 0原文

我的(沙箱)应用程序内购买正在运行,但如何确定应用程序是否正忙于与服务器通信?我很难让我的正常 ActivityiyIndi​​cator 在这种设置下工作,该应用程序似乎在整个过程中进进出出响应能力。然后,如果用户在完成交易之前关闭屏幕,他们可能会陷入人为循环,如果他们在下载完成之前继续关闭屏幕,他们可能永远无法获得下载。

任何示例或建议将不胜感激。

I have my (sandbox) In App Purchase working, but how do I determine if the app is busy communicating with the server? I am having a rough time getting my normal ActiviyIndicator to work in this setting, the app seems to go in and out of responsiveness throughout the process. Then if the user closes the screen before finishTransaction, they can get caught in a human made loop where they might never get their download, if they keep closing the screen before the download is done.

Any examples or suggestions would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不寐倦长更 2024-10-08 02:29:06

您应该通过响应委托方法并实现 SKPaymentTransactionObserver 来管理通信。

如果用户在交易完成之前关闭应用程序,则该过程将/应该在用户下次打开应用程序时恢复。

您的应用程序应在启动时将观察者与支付队列相关联,而不是等到用户尝试购买商品时才进行。当应用程序终止时,事务不会丢失。下次应用程序启动时,Store Kit 将恢复处理事务。在应用程序初始化期间添加观察者可确保所有事务都返回到您的应用程序。

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html#//apple_ref/doc/uid/TP40008267-CH3-SW1

You should manage the communication by responding to the delegate method(s), and also implementing the SKPaymentTransactionObserver.

If the user closes the app before the transaction is completed, the process will/should be restored on the next time that the user opens the app.

Your application should associate an observer with the payment queue when it launches, rather than wait until the user attempts to purchase an item. Transactions are not lost when an application terminates. The next time the application launches, Store Kit resumes processing transactions. Adding the observer during your application’s initialization ensures that all transactions are returned to your application.

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html#//apple_ref/doc/uid/TP40008267-CH3-SW1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文