Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically getting the iPhone's carrier signal strength

Is there a way to get the iPhone's carrier, and/or the current signal strength, using Objective-C? I know how to determine if a data connection is present, and whether or not that connection is wi-fi vs. cellular. I also know that you can manually place the iPhone into "field test" mode by going to the phone app, and dialing #3001*12345*# and hitting Send.

like image 955
Dan Bourque Avatar asked Aug 13 '09 04:08

Dan Bourque


People also ask

How do I check cellular signal strength on my iPhone?

You can check your iPhone signal strength by using its secret Field Test mode. Open the Phone app and dial *3001#12345#*on the keypad. In a few seconds, you'll see a mishmash of numbers. On the top right side, there is a menu.

Is there any app to see signal strength of all networks available in iOS?

Opensignal is a fully-featured mobile connectivity and network signal speed test tool. Find the best network provider in your area. Compare coverage on Sprint, T-Mobile, AT&T and Verizon. Opensignal speed tests measure your real experience of mobile connectivity and signal.

How do I check signal strength on iOS 15?

To see your signal strength represented by a number — and watch it change depending on how strong your signal is as you move around — go to your keypad and enter *3001#12345#. Next, press the call button. Once there, a Main Menu screen should appear.


2 Answers

You made me curious and I found out that it's actually *3001#12345#* (hashes and stars exchanged).

like image 181
Hauke Avatar answered Sep 29 '22 22:09

Hauke


This probably won't pass Apple's review, but you can use CTTelephony notifications. First, link against CTTelephony. Now just use this:

static void callback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {

    CFShow(name)

    NSString *sName = name;
    if ([sName isEqualToString:@"kCTIndicatorsSignalStrengthNotification"]) {
        if (userInfo) CFShow(userInfo);
    }    
}

And this to subscribe:

id ct = CTTelephonyCenterGetDefault(); 

    CTTelephonyCenterAddObserver(
                                 ct, 
                                 NULL, 
                                 callback,
                                 NULL,
                                 NULL,
                                NULL);
like image 30
fbernardo Avatar answered Sep 29 '22 22:09

fbernardo