CoreTelephony - 处于飞行模式时的 carrierName
CoreTelephony - carrierName when in Airplane Mode
我有以下代码来获取我的服务提供商的运营商名称:
let ctTelePhony = CTTelephonyNetworkInfo()
func cellPhoneServices() -> String {
let serviceProvider = ctTelePhony.subscriberCellularProvider
if let carrierName = serviceProvider?.carrierName {
globalCarrierName = carrierName
return carrierName}
else {
globalCarrierName = "Nil"
return "Nil"}
}
根据文档,subscriberCellular
Provider 已被弃用并被 serviceSubscriberCellularProviders
取代,但是在使用该服务时,它 returns nil。
主要问题是:当我使用上面的代码时,我得到了航空公司名称,但是当我切换到飞行模式时,我仍然得到了我的航空公司名称。
运营商信息是否存储在 phone 本地?使用*3001#12345#*
服务时,如果是飞行模式,所有信息都不会显示。
@property(nonatomic, readonly, retain) NSString *carrierName;
如果我们为运营商配置设备,将设备置于飞行模式,即使 SIM 卡被移除,设备仍然 return 运营商。运营商信息可能会安全地保存在设备内部的某个地方。
This string is provided by the carrier and formatted for presentation
to the user. The value does not change if the user is roaming; it
always represents the provider with whom the user has an account.
If you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier.
The value for this property is nil if the device was never configured
for a carrier.
我有以下代码来获取我的服务提供商的运营商名称:
let ctTelePhony = CTTelephonyNetworkInfo()
func cellPhoneServices() -> String {
let serviceProvider = ctTelePhony.subscriberCellularProvider
if let carrierName = serviceProvider?.carrierName {
globalCarrierName = carrierName
return carrierName}
else {
globalCarrierName = "Nil"
return "Nil"}
}
根据文档,subscriberCellular
Provider 已被弃用并被 serviceSubscriberCellularProviders
取代,但是在使用该服务时,它 returns nil。
主要问题是:当我使用上面的代码时,我得到了航空公司名称,但是当我切换到飞行模式时,我仍然得到了我的航空公司名称。
运营商信息是否存储在 phone 本地?使用*3001#12345#*
服务时,如果是飞行模式,所有信息都不会显示。
@property(nonatomic, readonly, retain) NSString *carrierName;
如果我们为运营商配置设备,将设备置于飞行模式,即使 SIM 卡被移除,设备仍然 return 运营商。运营商信息可能会安全地保存在设备内部的某个地方。
This string is provided by the carrier and formatted for presentation to the user. The value does not change if the user is roaming; it always represents the provider with whom the user has an account.
If you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier.
The value for this property is nil if the device was never configured for a carrier.