2014-07-24 75 views
1

我已經完成了大部分的事情來獲得我的手機運營商的可用性。我通過使用CTGetSignalStrength()和SIM卡狀態CTSIMSupportGetSIMStatus();獲得了信號強度。如何檢測運營商可用或不在iphone?

但它總是返回kCTSIMSupportSIMStatusReady。現在,如果丟失了我的網絡連接,它將返回與相同的狀態。kCTSIMSupportSIMStatusReady

那麼,有沒有什麼方法可以在iphone中獲取丟失任何信號的通知?我的應用程序不需要互聯網連接。

+0

這是應用程序商店的應用程序? – Mani

+0

是的,這是應用商店。 –

+0

App Store不會接受獲取信號強度和SIM卡狀態。這樣做沒有明確的文件。看到這篇文章http://stackoverflow.com/questions/14604273/accurately-reading-of-iphone-signal-strength – Mani

回答

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之間的區別?

+0

不,我想只檢查我的SIM卡是否在覆蓋區域。並且還希望獲得我的載波信號狀態。 –

+0

你可以檢查你是否有互聯網,然後你可以檢查與你的連接相關的傳輸層(3G,GSM,EDGE,EDGE +等)。解決方法就是這樣,你可以按照我告訴你的方式做到這一點。 – AlfuryDB