I would like to enable the app to persist a stable SIM identifier and compare it across app sessions so it can reliably detect when the user has changed SIM cards. When a SIM change is detected—especially while the device is on Wi-Fi—the app should trigger SIM-change handling (for example: refresh auth/session, reload account-specific data, and update feature availability).
The implementation must be robust for:
Dual-SIM and eSIM devices Temporary network unavailability or delayed carrier info
Current challenge: On Wi-Fi, the existing hash can distinguish a different operator but cannot reliably detect a SIM-card-level change. We need a way to uniquely identify the SIM card itself, not just the operator.
Is there any mechanism to obtain a hashed or tokenized representation of the SIM/subscriber identity … ?
No.
You could file an enhancement request for that, but I don’t fancy its chances. Such an API could be used for fingerprinting, which is something that Apple is actively working against. See the footnote about entropy at the bottom of this reply.
are there any Apple-recommended approaches to uniquely distinguish between different SIM cards over time … ?
No, but an ER along those lines seems more viable to me.
The gap is this
One way to close that gap would be for you to stand up a web service that allows your app to request some sort of authorisation token when that service is accessed over WWAN. Your app could then force that request to run over WWAN, get the token, and apply it to the real requests running over Wi-Fi. This would eat a small amount of mobile data, but much less than it would if you forced the entire transaction to run over WWAN.
Forcing a request to run over WWAN is not trivial, but it’s definitely possible, especially when it’s a low-complexity request like this one. See Extra-ordinary Networking > Running an HTTP Request over WWAN.
Obviously such a design would need a proper security audit — to limit the lifetime of these tokens, protect against replay attacks, and so on — but I think the overall approach is feasible.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"