1
A
回答
0
使用CTTelephonyNetworkInfo以为你可以检测到SIM卡是否可用。
CTTelephonyNetworkInfo *network_Info = [CTTelephonyNetworkInfo new];
CTCarrier *carrier = network_Info.subscriberCellularProvider;
//will return the actual country code
NSLog(@"ISO country code is: %@", [carrier.isoCountryCode uppercaseString]);
如果发现空[carrier.isoCountryCode uppercaseString]比卡贴是不是在您的设备提供。
试试这个!
1
根据该文件[CTCarrier CARRIERNAME]:
如果配置设备的载体,然后取出SIM卡,该属性保留了承运人的名称。
据我所知,你不能检测是否安装了SIM卡。您只能确定使用可达性WWAN连接是否可用。
0
public int checkSim(){
TelephonyManager telMgr = (TelephonyManager) context.getSystemService(
Context.TELEPHONY_SERVICE);
int simState = telMgr.getSimState();
switch (simState) {
case TelephonyManager.SIM_STATE_NETWORK_LOCKED:
case TelephonyManager.SIM_STATE_PIN_REQUIRED:
case TelephonyManager.SIM_STATE_PUK_REQUIRED:
case TelephonyManager.SIM_STATE_READY:
return SIM_PRESENT;
case TelephonyManager.SIM_STATE_UNKNOWN:
case TelephonyManager.SIM_STATE_ABSENT:
default :
return SIM_ABSENT;
}
}
使用此代码为SIM iOS上检查
+0
这将检查是否存在SIM卡,但我需要检查是否没有像989xxxx640在设备中可用。 –
相关问题
- 1. 如何检测SIM卡1或SIM卡2上的呼叫
- 2. 检查移动数据是从SIM卡或SIM卡2 Android
- 3. 检测移动设备
- 4. navigator.userAgent检测移动设备?
- 5. 检测设备移动
- 6. 使用Out Sim卡激活移动设备
- 7. J2ME SIM卡更改检测
- 8. 检测SIM卡改变(codenameOne)
- 9. 移动设备被检测为非移动设备
- 10. 检测双SIM卡Android手机中两张SIM卡的状态
- 11. 如何检测设备的移动?
- 12. 检测移动设备的Java
- 13. 检测设备向前移动
- 14. 检测室内移动设备(J2ME)
- 15. Rspec强制mobile_fu检测移动设备
- 16. 使用JavaScript检测移动设备
- 17. 检测窗口移动设备
- 18. Xamarin iOS项目引用绑定在SIM卡上启动,但不在设备上
- 19. PyUsb:检测设备移除
- 20. writeToFile在SIM卡中工作,但不在设备上
- 21. 如何检测设备是否没有使用iphone sdk的SIM卡?
- 22. 检测移动设备和桌面设备上的字符代码
- 23. 如何检测移动设备上的ActiveSync连接?
- 24. 检测移动设备 - 和平板设备
- 25. 使用sharedpreferences检测SIM卡更改
- 26. Android电话管理器检测SIM卡
- 27. 如何检查SIM卡是否可用于Android设备?
- 28. 在移动设备上
- 29. Three.js检测视频已准备好在移动设备上播放
- 30. 检测SIM卡变更或使用官方iOS SDK找到SIM卡的IMSI?
你不能获得用户号码。这是一个隐私问题。 – Paulw11