Checking SIM Status on iPhone

I am developing an iOS application. In that i should show a status of their cellular provider such as Active, Inactive, or sim not available. Which also includes physical and eSim. I used Telephony.CTcarrier. One thing its deprecated and another case iOS 15 and below, even if i put my device in Airplane mode still its returning the carrierName and NetworkCode.

Is there any specific API to retrieve these realtime data?

TIA

Answered by DTS Engineer in 796617022
Is there any specific API to retrieve these realtime data?

Not via APIs in the iOS SDK.

If you’re working for on behalf of a carrier, you should discuss your goals with your carrier’s contact at Apple. If not, this sort of information is not available in any reliable way.

if i put my device in Airplane mode still its returning the carrierName and NetworkCode.

Right. This is more fallout from the ‘latching’ behaviour I mentioned in your other thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there any specific API to retrieve these realtime data?

Not via APIs in the iOS SDK.

If you’re working for on behalf of a carrier, you should discuss your goals with your carrier’s contact at Apple. If not, this sort of information is not available in any reliable way.

if i put my device in Airplane mode still its returning the carrierName and NetworkCode.

Right. This is more fallout from the ‘latching’ behaviour I mentioned in your other thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Thanks for the update!

hi @DTS Engineer, we noticed that the GPay application that installed in iOS 17.5.1 giving error "Cannot detect the sim card" when the airplane mode is enabled OR the sim is removed from the device (both different scenarios).

How this is possible ?

I’m not able to comment on other developer’s apps.

In general, I have seen a lot of apps try to infer the presence of a SIM based on the state of other subsystems. For example, you might check the state of the WWAN interface [1] and infer the SIM state from that. This is not a good idea, IMO, because it’s easy for the system to change in a way that breaks your inference chain.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] If you decide you want to play that particular game, against my advice, check out the posts linked to by Extra-ordinary Networking.

Checking SIM Status on iPhone
 
 
Q