6

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

The setup

  • The app has received the public-cellular-plan entitlement which I understand is the entitlement giving me access to the eSIM functions of CoreTelephony.
  • I've imported the CoreTelephony framework in the app's target: General > Frameworks, Libraries, and Embedded Content which is marked as Do not Embed, same as other frameworks like CoreData and such.
  • I've imported the library in the class making the calls import CoreTelephony
  • I'm running a development build with the correct profile via Xcode on an iPhone XR, which has a data plan active so I'm sure it supports it.

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?

2
  • 1
    I am also having the same issue, any update?
    – n....
    Commented Feb 7, 2020 at 4:44
  • Did you ever get a resolution to this? I am having the same issue
    – Matt Rees
    Commented Jun 4, 2020 at 9:20

3 Answers 3

8

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.

6
  • If we ever cross paths I owe you a beer
    – Matt Rees
    Commented Jun 10, 2020 at 8:19
  • I'll remember that ;)
    – Thomas
    Commented Jun 10, 2020 at 11:24
  • what is CarrierDescriptors. can you please share me the sample CarrierDescriptors which we need to place in info.plist @Thomas Commented Jun 18, 2020 at 7:20
  • 1
    @nareshkolindala The CarrierDescriptors is a dictionary of unique codes given by your Carrier that identify them on the network. You should check with them for these codes.
    – Thomas
    Commented Jun 19, 2020 at 8:33
  • @Thomas could you please, give a example what should it be looked in info.plist?
    – Marat
    Commented Nov 30, 2020 at 6:34
0

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>
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.