Search code examples
iphoneobjective-ccore-telephony

Use Core Telephony For Universal Application


My Application is using Core Telephony Framework.My application is a universal app and supports both Ipad and Iphone.I tested on Verizon Ipad and I was able to get the carrier using Core Telephony.How should I deal with core telephony on Ipad devices only with Wifi.Will core telephony class returns NULL on ipad with Wifi or is it going to crash my application on those devices.

CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [networkInfo subscriberCellularProvider];
NSString *currentCountry=[carrier isoCountryCode];
[networkInfo release];

I use this and it works fine on Verizon Ipad.


Solution

  • I just ran the code for you, and it doesn't crash.

    This is the dump of the CTCarrier

    TCarrier (0x1f2330) {
        Carrier name: []
        Mobile Country Code: []
        Mobile Network Code:[]
        ISO Country Code:[]
        Allows VOIP? [YES]
    }