iPhone - how to determine carrier of the device (AT&T, Verizon, etc?)

后端 未结 3 415
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 20:14

Is there a way to get information about the carrier of iPhones programmatically?

3条回答
  •  悲哀的现实
    2021-02-01 20:43

    1st Import #import as well as #import (make sure you have the CoreTelephone.framework installed too).

    CTTelephonyNetworkInfo *phoneInfo = [[CTTelephonyNetworkInfo alloc] init];
    CTCarrier *phoneCarrier = [phoneInfo subscriberCellularProvider];
    NSLog(@"Carrier = %@", [phoneCarrier carrierName]);
    [phoneInfo release];
    

提交回复
热议问题