帮助解决应用内购买超时问题
得益于精心编写的应用内购买编程指南,我的应用内购买设计得非常完美。不幸的是,我遇到了最后一个障碍。除了这一次购买之外,我的应用程序完全离线运行 - 所以我希望有一个简单的解决方案,而无需实现大量的网络代码。
基本上,如果我尝试使用未连接到互联网的设备进行连接以进行应用内购买,则 SKProductsRequest 的超时时间会长得离谱(5 分钟以上)。我的应用程序是一个免费的演示应用程序,只有一次购买,因此允许在后台进行购买并不理想,因为用户在等待没有网络的超时解释时会被困在功能有限的应用程序中联系。
有没有什么简单的方法可以测试设备上的App Store是否可用? [SKPaymentQueue canMakePayments] 在这里没有帮助。我见过的代码解决方案非常复杂。
理想情况下,我想在用户进入购买演示屏幕时检查这一点,并且我会弹出一个警报视图,指出没有可用的网络。
谢谢!
I've designed my In-App purchase to work perfectly thanks to the well-written in-App Purchase Programming Guide. Unfortunately, I have run into one last snag. My app runs entirely offline except for this one purchase - so I'm hoping there's a simple solution without having to implement tons of net code.
Basically, if I try to connect to make an in-App purchase with a device that is not connected to the internet, the timeout is ridiculously long (5+ minutes) on the SKProductsRequest. My app is a free demo app, with only one purchase, so allowing the purchase to occur in the background is not ideal, as the user would be stuck in the app with limited functionality while they wait for the timeout explanation that they have no network connection.
Is there any easy way to test if the App Store is available on the device? [SKPaymentQueue canMakePayments] does not help here. The code solutions I have seen have been extremely complicated.
Ideally, I would want to check this when a user enters the buy-demo screen and I would pop up an alertview saying no network is available.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需使用 Apple 的可达性类别来检查一般互联网连接,并且仅在有 WWAN/WLAN 连接可用时才允许该按钮。
http://developer.apple.com/library/ios/ #samplecode/Reachability/Introduction/Intro.html
Just use Apple's Reachability Classes to check for general internet connectivity and only allow the button if there is WWAN/WLAN connection available.
http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html