简体   繁体   English

检测SIM卡更换

[英]Detect SIM card replacement

Is there any way to know if the user has changed his SIM card with a different SIM card? 有没有办法知道用户是否用其他SIM卡更换了他的SIM卡?

really what I want to do is to know from which number he is using right now, I mean if so far he used some phone number and now he changed his phone number to a different number, can I detect it? 我真正想做的就是知道他现在使用的是哪个号码,我的意思是,如果到目前为止他使用的是某个电话号码,现在他将其电话号码更改为另一个号码,我可以检测到吗?

Thanks in advance. 提前致谢。

You should sign up for a notification using subscriberCellularProviderDidUpdateNotifier in http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CTTelephonyNetworkInfo/Reference/Reference.html 您应该使用http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CTTelephonyNetworkInfo/Reference/Reference.html中的 subscriberCellularProviderDidUpdateNotifier签署通知。

But, you're only be notified if the swap occurs while your app is running. 但是,只有在应用程序运行时发生交换时,您才会收到通知。 you're still be unable to detect if the user changes the SIM to another SIM from the same operator when your app is not running. 当您的应用未运行时,您仍然无法检测到用户是否从同一运营商将SIM更改为另一SIM。

And if you want to get access only on jailbroken device ? 而且,如果您只想访问越狱的设备?

Then you should find file on path /private/var/root/Library/Lockdown/data_ark.plist 然后,您应该在路径/private/var/root/Library/Lockdown/data_ark.plist找到文件

the key is InternationalMobileSubscriberIdenti 关键是InternationalMobileSubscriberIdenti

You can not read sim number with public api. 您无法使用公共API读取SIM卡号码。 You can only detect if the sim card is changed, take a look to Core Telephony Framework Reference . 您只能检测sim卡是否已更改,请参阅《 Core Telephony Framework Reference》

When you detect a sim card change you can ask nicely the user to enter his phone number and validate it via an sms system. 当您检测到SIM卡更改时,可以很好地要求用户输入其电话号码并通过短信系统对其进行验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM