The warning is telling you that you should use CTTelephonyNetworkInfo().serviceSubscriberCellularProviders
instead, that returns an optional dictionary of type [String : CTCarrier]?
. Probably is added to support devices with multiple sim (eg. iPhone XR with SIM + eSIM)
I can't figure out which key to use with the dictionary, in my case (iPhone 8) I have only one object with key 0000000100000001
so I get the carrier with:
CTTelephonyNetworkInfo().serviceSubscriberCellularProviders?["0000000100000001"]
You could try with:
CTTelephonyNetworkInfo().serviceSubscriberCellularProviders?.first?.value
but obviously there’s not guarantee that you will get the same info between different executions of your app.
I couldn't find any further documentation about it
serviceSubscriberCellularProviders
instead ofsubscriberCellularProvider
– Claque