How to debug Call Directory Extension?

I've tried to attach to Phone process (and many others) but incoming call is not hitting breakpoint in CXCallDirectoryProvider.beginRequest

Considering lack of documentation what am I doing wrong?

Thanks in advance!

Replies

No idea, I've not experienced any problems with it not appearing. Have you just tried creating a basic template extension (create a new project of type application, then create a new target of type call directory extension, and make sure the developer team is set to the same for each). Then run the containing app scheme or etension scheme the via xcode and it should appear

royycc, is that some documentation you are quoting from in the first couple of paragraphs? If so where is it? (I couldn't find that in the Apple API reference documentation for this stuff).

Thanks for the clue!

It only started displaying my identified numbers when I put at least one number in the blocked numbers array.

>> "It would be nice if a CallHit callback is provided when a call hit the blocked list"


Does that mean you have been able to get call blocking to work? I'm able to get call identification to work but not call blocking.


If I add a number to block like this:


    private func retrievePhoneNumbersToBlock() -> [String]? {
          return ["+12067958411"]
    }

Then make a call from the number, then there's no difference - the incoming call still displays just as usual. (I've ensured the number is being added by the extension without a problem by calling reloadExtensionWithIdentifier)


Is there anything else you did to get call blocking to work?

Seconded, where's this documentation coming from?

Look at the API of all the CXCallDirectory ( justa 5 available api .... ), then you would understand how it works.

https://developer.apple.com/library/prerelease/content/releasenotes/General/iOS10APIDiffs/Swift/CallKit.html


I tried both call blocking and identification successfully.


- In blocking, you would not notice anything on the phone, that number just cant' call in.

- For call identifcation, it display the text 「APPNAME」Caller ID : LABEL


If you made identifcation working, the number should be correct. May be try adding a breakpoint to ensure the code execute as you expect.

Ditto. I am able to successfully provide a caller ID, and I added an NSLog that is showing that the code that adds the blocked number is running with seemingly no error, however the number is not blocked. I've tried lots of variations on the phone number string, including +(country code)(phone number).


Is there something displayed to the console by iOS when a phone number is blocked or being checked if it should be blocked?


I am seeing reports of it working for folks in countries other than the USA, so I wonder if that is somehow a factor.

This is definitely a caching issue on the iOS 10 beta 1 side. I restored my phone and installed the app, and it blocked the number I specified.

Were you able to find a way to make it work every time ?

I have no problems making the "Identification" work, but the blocking part is not working for me.


When looking at the logs from my device, I can see an entry saying :

com.apple.CallKit.CallDirectory[251] <Notice>: Added 1 phone number blocking entries
com.apple.CallKit.CallDirectory[251] <Notice>: Data request completed successfully


But I am still able to call myself :/ (I'm on the iOS10 second public beta)


By the way, for the persons that are looking for the NSLog, the only way I found to get access to them is by going into the "Devices" window of Xcode and looking at the device console.

i have a scenario like fetching the contacts from contacts framework and picking the selected contacts from the contacts framework and passing the selected list of contacts(array) to CALLKIT.

Once i get a call from any of the selected(which i picked earlier from contacts framework and passed it to call kit extension)...my bluetooth device has to vibrate(generally notifying the user)

i would like to know...whether we can pass array(selected contacts) to call kit extension and get notified if we get a call from the array(selected contacts) which we passed to call kit extension method

(BOOL)addIdentificationPhoneNumbersToContext:(CXCallDirectoryExtensionContext *)context;

Try debugging the enabled status:

`

var callDirManager = CXCallDirectoryManager.sharedInstance

callDirManager.getEnabledStatusForExtension(withIdentifier: "com.dimez.CallBlock.CallDirectoryBlockage") { (cXCallDirectoryManagerEnabledStatus) in

print("Enabled status of extension: \(cXCallDirectoryManagerEnabledStatus.0)")

print("Possible error: \(String(describing: cXCallDirectoryManagerEnabledStatus.1))")

}

extension CXCallDirectoryManager.EnabledStatus: CustomStringConvertible {


public var description: String {

switch self{

case .disabled:

return "disabled"

case .enabled:

return "enabled"

case .unknown:

return "unknown"

}

}

}

`

Shouldn't say this:

Enabled status of extension: disabled