无法获得运营商网络名称IOS

时间:2014-05-17 07:59:23

标签: ios core-telephony

我正在尝试检测SIM名称。我曾尝试过这段代码,但它没有用。 enter image description here

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];

    NSLog(@"simname = %@",    [[CTCarrier alloc]carrierName]);

    CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init];
    CTCarrier* carrier = info.subscriberCellularProvider;
    NSString *mobileCountryCode = carrier.mobileCountryCode;
    NSString *carrierName = carrier.carrierName;
    NSString *isoCountryCode = carrier.isoCountryCode;
    NSString *mobileNetworkCode = carrier.mobileNetworkCode;

    NSLog(@"simname %@",carrierName);

    isPresented = YES;
    SelectedClub = -1;



}

OUTPUT显示

2014-05-17 12:54:31.574 xxxx[4302:60b] simname = (null)
2014-05-17 12:54:31.583 xxxx[4302:60b] simname Carrier 

更多我想知道苹果是否允许获取SIM名称。

0 个答案:

没有答案