我需要知道 iOS 返回的是 sim 运营商名称,还是网络运营商名称。
在 iOS 中,我通过以下方式访问运营商信息:
CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier* carrier = networkInfo.subscriberCellularProvider;
NSString* iOSCarrierName = carrier.carrierName;
在 Android 中,有两种显式方法可以获取其中之一:
import android.telephony.TelephonyManager;
String networkCarrierName = telephonyManager.getNetworkOperatorName();
String simCarrierName = telephonyManager.getSimOperatorName()
最佳答案
documentation表示 subscriberCellularProvider
是
A CTCarrier object that contains information about the user’s home cellular service provider—that is, the provider with whom the user has an account.
所以这肯定是 sim 运营商名称。 More info
关于ios - iOS 中返回的运营商名称是网络运营商名称还是 sim 运营商名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39979307/