慢速网络上的应用内购买
更新:6 分钟后我收到“无法连接到 iTune Store”警报。是否可以在应用内购买时设置任何超时值。
我的应用内购买代码在正常网络中工作正常,但在非常慢的网络中(safari 浏览器将需要 5 分钟才能加载网页)。我没有得到任何代表...
- (void)requestDidFinish:(SKRequest *)request
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
所以我的代码无限期地阻塞,因为我最初将 setUserInteractionEnabled 设置为 FALSE 并在上述代表中将其设置回 TRUE...
[[[UIApplication sharedApplication]keyWindow]setUserInteractionEnabled:FALSE];
是否可以在创建“SKProductsRequest”或任何其他内容之前检查网络状态实施应用内购买的更好方法?我可以使用任何超时机制吗?
提前致谢,
Updated : I got "cannot connect to iTune Store" alert after 6 minutes. Is it possible to set any time out value while inApp Purchase.
My InApp purchase code works fine in normal network, but in very slow network(safari browser will take 5 min to load a webpage). I am not getting any delegates...
- (void)requestDidFinish:(SKRequest *)request
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
So my code blocks indefinetly because i am setting setUserInteractionEnabled to FALSE initially and setting it back to TRUE in the above delegates...
[[[UIApplication sharedApplication]keyWindow]setUserInteractionEnabled:FALSE];
Is it possible to check the network status before creating "SKProductsRequest" or any better way to implement inApp Purchase? Can i use any timeout mechanism?
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Apple 提供的
Reachability
代码示例来检查网络是否已启用。关于代码阻塞,您是否认为您的设计并不理想?设置此进程不锁定用户并让它在后台运行。You can use the Apple-Provided
Reachability
code sample to check if network is enabled. Regarding the code blocking, have you considered that your design is not ideal? Setup this process to NOT lock out the user and let it run in the background.