I need to make sure that incoming phone calls cannot interrupt the recordings that my clients make, so I prompt them to go to airplane mode but still turn on wifi. The method above from AlBeebe didn't work for me on iOS 8.1.3, but If found this solution which should work in iOS 7 and later:
You must add and import the CoreTelephony.framework.
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
Define the property on your class if you want to track changes
@property (strong, nonatomic) CTTelephonyNetworkInfo* networkInfo;
Init the CTTelephonyNetworkInfo
:
self.networkInfo = [[CTTelephonyNetworkInfo alloc] init];
NSLog(@"Initial cell connection: %@", self.networkInfo.currentRadioAccessTechnology);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(radioAccessChanged) name:CTRadioAccessTechnologyDidChangeNotification object:nil];
And then you will receive callback when it changes:
- (void)radioAccessChanged {
NSLog(@"Now you're connected via %@", self.networkInfo.currentRadioAccessTechnology);
}
The values for currentRadioAccessTechnology
are defined in
CTTelephonyNetworkInfo.h and you'll get back null / nil when there is no cell tower connection.
This is where I found it: http://www.raywenderlich.com/48001/easily-overlooked-new-features-ios-7