why do serviceSubscriberCellularProviders return nil? (in iOS 12)

前端 未结 2 1808
面向向阳花
面向向阳花 2021-02-06 10:28

Question about CTCarrier from CoreTelephony. I heard that I should use serviceSubscriberCellularProviders instead of subscriberCellularProvider in iOS 12 because subscriberCellu

相关标签:
2条回答
  • 2021-02-06 11:01

    It's a bug in iOS 12.0.x, and it has fixed in iOS 12.1

    0 讨论(0)
  • 2021-02-06 11:20

    I think it's an Apple's bug. Try this:

        CTTelephonyNetworkInfo *networkStatus = [[CTTelephonyNetworkInfo alloc] init];
    if (@available(iOS 12.0, *)) {
        NSDictionary *info = networkStatus.serviceSubscriberCellularProviders;
        NSLog(@"%@", [networkStatus valueForKey:@"serviceSubscriberCellularProvider"]);
    }
    

    It works well on iPhone XS Max (double Sim cards).And it seems to be a private method.

    0 讨论(0)
提交回复
热议问题