0

我已经做了大部分事情来让我的电话运营商可用。我通过 using 获得信号强度,通过 获得CTGetSignalStrength()SIM 状态CTSIMSupportGetSIMStatus();

但它总是返回kCTSIMSupportSIMStatusReady现在,如果我的网络连接丢失,它也会返回与kCTSIMSupportSIMStatusReady相同的状态。

那么,有什么方法可以通知iphone中丢失任何信号吗?我的应用不需要互联网连接。

4

1 回答 1

1

您始终可以使用可达性(包含在 AFNetworking 中)

Reachability *reachability = [Reachability reachabilityForInternetConnection];
[reachability startNotifier];

NetworkStatus status = [reachability currentReachabilityStatus];

if(status == NotReachable) 
{
    // in this case there is no internet connection
}
else if (status == ReachableViaWiFi)
{
    // in this case there is WiFi connection
}
else if (status == ReachableViaWWAN) 
{
    // in this case there 3G connection, WCDMA-umts
}

您需要检查 WCDMA-UMTS、GPRS、GSM 之间的区别吗?

于 2014-07-24T11:54:35.343 回答