在iPhone应用程序上具有可否肯定性的可到达性-它会超越苹果吗? [英] Reachability on iPhone app with a false positive - will it get past apple?

查看:47
本文介绍了在iPhone应用程序上具有可否肯定性的可到达性-它会超越苹果吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码...

I am using this code...

Reachability *r = [Reachability reachabilityWithHostName:@"www.maxqdata.com"];

NetworkStatus internetStatus = [r currentReachabilityStatus];

if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN))
{
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"You require an internet connection via WiFi or cellular network for location finding to work." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[myAlert show];
[myAlert release];
} 

从该线程

http://www.iphonedevsdk.com/forum/iphone-sdk-development/19546-no-wifi-connection-best-practice-2.html#post118631

检查互联网连接.原则上这是可行的,但是在蜂窝网络可用但无法激活的情况下,我得到了误报,对于这种情况下的检测方法,有人有什么想法吗?

to check for internet connections. Whilst this is working in principle I am getting a false positive in the situation when a cellular network is available but can't be activated, does anyone have any ideas on how to detect for this scenario?

或者这很可能发生,所以很少我总是可以忽略它,并在NSURLConnection方法无法连接时给出错误-我担心的是,它可能无法通过审查过程,任何人都没有任何经验这个吗?

Alternatively this is likely to happen so rarely I can always just ignore it and give an error when the NSURLConnection method can't connect - my worry here is that it may not get past the vetting process, does anyone have any experience with this?

谢谢

推荐答案

我某些应用程序中包含的唯一可访问性"代码是:如果连接超时,则显示错误-只要您处理的是间歇性操作或否优雅的连通性将超越以往的审查.崩溃,或者永远挂着等待响应将使您被拒绝.根据经验,我会说用户会接受的任何内容,我也发现苹果公司也可以*.

The only "reachability" code I've included in some of my apps is to display an error if connections time out - as long as you handle intermittent or no connectivity gracefully it will get past vetting. Crashing out, or hanging waiting for a response forever will get you rejected. As a rule of thumb, I'd say anything the user will find acceptable, I've found Apple do too *.

*(** 您的里程可能会有所不同)

这篇关于在iPhone应用程序上具有可否肯定性的可到达性-它会超越苹果吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆