12

I am developing an app for a mobile carrier. First I wanted to find any of the things (IMSI, ICCID, IMEI, MSISDN) so that I can detect if the SIM is related to my mobile carrier. But I guess Apple doesn't allow that.

Now as a workaround I will ask the user to register his phone number with my app. But then again bad things will happen if user changes the SIM.

Is there any way for me to detect SIM change using the official iOS SDK?

User97693321
  • 3,336
  • 7
  • 45
  • 69
orak
  • 2,399
  • 7
  • 29
  • 55
  • If no SIM is inserted, `CTCarrier.isoCountryCode` returns `nil`. http://developer.apple.com/library/ios/ipad/#DOCUMENTATION/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/doc/uid/TP40009596-CH1-SW1 –  Aug 03 '12 at 04:50
  • but i want to detect a SIM change... – orak Aug 03 '12 at 05:11
  • possible duplicate of [Is it possible to determine if the SIM/Phone number has changed?](http://stackoverflow.com/questions/10872117/is-it-possible-to-determine-if-the-sim-phone-number-has-changed) – CodaFi Aug 03 '12 at 05:34
  • Take into account that it is possible to change the phone number without changing SIM card. – Enrique Aug 03 '12 at 07:21

2 Answers2

6

You can get access only on jailbroken device.

Find file on path /private/var/root/Library/Lockdown/data_ark.plist

the key is InternationalMobileSubscriberIdenti

balexandre
  • 73,608
  • 45
  • 233
  • 342
Igor
  • 4,235
  • 3
  • 34
  • 32
3

should sign up for a notification using subscriberCellularProviderDidUpdateNotifier in http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CTTelephonyNetworkInfo/Reference/Reference.html

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.

bitmapdata.com
  • 9,572
  • 5
  • 35
  • 43
  • is this worked at your end? how you did it can you help me i tried below code but not working info.subscriberCellularProviderDidUpdateNotifier = { inCTCarrier in DispatchQueue.main.async(execute: { print("sim changed") }) } – Pooja M. Bohora Aug 14 '20 at 10:57