ios12双卡双待蜂窝数据载体

时间:2018-12-19 12:11:13

标签: ios12 dual-sim carrier

如何通过iPhone XR或iPhoneXS Max的双SIM卡获得蜂窝数据SIM卡的载体。我有两张卡的运营商信息,但找不到一个蜂窝数据。

CTCarrier *carrier;
if (@available(iOS 12.1, *)) {
    if ([self.telephonyNetworkInfo respondsToSelector:@selector(serviceSubscriberCellularProviders)]) {
        NSArray *carrierInfos = [[self.telephonyNetworkInfo performSelector:@selector(serviceSubscriberCellularProviders)] allValues];
        if (carrierInfos && [carrierInfos count] > 0) {
            carrier = carrierInfos[0];
        }
    }
} else if (@available(iOS 12.0, *)) {
    if ([self.telephonyNetworkInfo respondsToSelector:@selector(serviceSubscriberCellularProvider)]) {
        NSArray *carrierInfos = [[self.telephonyNetworkInfo performSelector:@selector(serviceSubscriberCellularProvider)] allValues];
        if (carrierInfos && [carrierInfos count] > 0) {
            carrier = carrierInfos[0];
        }
    }
}
if (!carrier) {
    carrier = [self.telephonyNetworkInfo subscriberCellularProvider];
}

调试信息: xcode console lldb info

0 个答案:

没有答案