CoreTelephony entitlements?

Are there any special entitelemtns to use CTCellularData, CTCellularPlanProvisioning


While I can use those classes without permissions error or debugger log message, the information returned does not seem to be accurate and the documentation pages for those classes is empty of content.


Even for a device with an active sim I get the following on iOS 12:


CTCellularData.restrictedState: CTCellularDataRestrictedState

CTCellularPlanProvisioning.supportsCellularPlan: false


Is there some entitlement that I need to make use of these new classes?


Thanks


Howard

>the documentation pages for those classes is empty


These don't appear to be empty when I view them:


https://developer.apple.com/documentation/coretelephony


class CTCellularData


class CTCellularPlanProvisioning


That said, as iOS 12 just dropped, it might be a matter of being patient. Feel free to make a request via the bug reporter link below, adding your report # to your thread for reference, thanks and good luck.

I can’t speak to

CTCellularPlanProvisioning
. I haven’t had a chance to look at that yet.

With regards

CTCellularData
, this is about the user’s ability to prevent apps from using WWAN (in Settings > {Cellular,Mobile} Data > SomeAppName). That does not require any entitlements. Here’s a snippet of code that shows it in action:
var cellularData: CTCellularData!

func setup() {
    self.cellularData = CTCellularData()
    self.cellularData.cellularDataRestrictionDidUpdateNotifier = { state in
        let stateStr: String
        switch state {
        case .restrictedStateUnknown: stateStr = "unknown"
        case .restricted: stateStr = "restricted"
        case .notRestricted: stateStr = "not restricted"
        }
        NSLog("cellular data state: %@", stateStr)
    }
}

If you then go into Settings and toggle access to WWAN, you see output like this:

2018-09-20 08:50:57… cellular data state: not restricted
2018-09-20 08:51:33… cellular data state: restricted
2018-09-20 08:51:42… cellular data state: not restricted

Some things to note:

  • Your app only shows up in Settings if it has used WWAN, so if you put this in a simple test app you’ll need to have that app run a request over WWAN before you start this test (which means adding some simple network code and running it with Wi-Fi disabled).

  • The notifier is only called when your app is running, so you see these callbacks when you switch back to the app from Settings.

  • I store my instance of

    CTCellularData
    in a property (
    cellularData
    ) to prevent it from being deallocated; if that happens the notifier never gets called.
  • I built my test with Xcode 10.0 and run it on iOS 12.0.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I can’t speak to

CTCellularPlanProvisioning
.

I had a chat with my colleague, who supports Core Telephony for DTS, and he indicated that

CTCellularPlanProvisioning
is intended to be used by carriers only. If you’re not working for a carrier, you should just ignore this API.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Eskimo,


I have the same problem with supportsCellularPlan function, I'm wondering whether your colleague who supports Core Telephony could help me with this. supportsCellularPlan always returns false to me even if I have the following:


macOS: Version 10.14
XCode: Version 10.1 beta 3 (10O45e)
iPhone XS Max with IOS 12.1(16B5077C)

Since supportsCellularPlan is supposed to tell whether the phone support eSIM, it's strange that it return false for me. What else I should do to get the right status?


Thanks for your help.

I'm wondering whether your colleague who supports Core Telephony could help me with this.

You should try opening a DTS tech support incident for this. My expectation is that your support request will be rejected (

CTCellularPlanProvisioning
is intended to be used by carriers and DTS does not support carrier-only APIs) but this isn’t really my bailiwick so I think it’s worth a shot just in case.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hey Eskimo,


I am working for the carrier can you let me know how to use this?

do you solve this problem?can you tell me what should do?thanks

You find solution?

yes

Hi, would you share how to get the entitlement? We wanna be a eSIM servcie supplier too.

We wanna be a eSIM servcie supplier too.

I believe the droid you’re looking for is this (can’t check it right now, there’s something wonky happening with my network).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
CoreTelephony entitlements?
 
 
Q