Thomas
Thomas

Reputation: 2063

CoreTelephony eSIM functions not working on device

I've been having some trouble implementing eSIM into an existing iOS carrier-application.

The setup

The problem
Supposedly with all this, I should now have access to the eSIM functions like supportsCellularPlan but unfortunately it doesn't seem to be working:

let provisioning = CTCellularPlanProvisioning()
let supportsESIM = provisioning.supportsCellularPlan()

print("\(supportsESIM)") 
// This prints false but should be true as the XR supports eSIM

I've also tried via TestFlight with the distribution profile but same result.

Any ideas as to what I'm doing wrong?

Upvotes: 6

Views: 2586

Answers (3)

esyx
esyx

Reputation: 41

You can find the correct MCC/MNC values here: https://www.mcc-mnc.com Btw for some reason, it also works for me, when there is just random value "xxx" for example. But it needs to be there in the plist.

Upvotes: 0

H.Gadou
H.Gadou

Reputation: 41

CarrierDescriptors Example:

  <key>CarrierDescriptors</key>
    <array>
      <dict> 
      <key>MCC</key> //Mobile country code
       <string>’mnc value’</string>
       <key>MNC</key> // Mobile network code
        <string>’mnc value’</string>
      </dict>
    </array>

Upvotes: 0

Thomas
Thomas

Reputation: 2063

So... after a lot of trial an error I was able to solve this little issue.

There are 2 things to know about supportsCellularPlan() (other then having the eSIM entitlements of course).

First:
You need to have WiFi enabled for it to work as it seems to need to connect with Apple for some checks.

Second:
It requires the CarrierDescriptors to be entered correctly in your info.plist as it is carrier-bound.

Once you have that, it should work as expected.

Upvotes: 8

Related Questions