call directory extension - error enabling extension

Hi all,


I was tring to build a app that test phone number identification. But I always got this problem and can't figure out why.


I tried several times to recreate project and reset the iPhone, but still not working.


Btw, I also tried to run my extension target, it's enable succeed, but function is not working, and it's shows the same error meesage if I switch it to disable and enable.


Here's my steps


1) Create a new project (Single View Appliction) with Xcode 8

2) Create a new target "Call Directory Extension"

3) Modify phone numbers provided in code.

4) Build and run the app.

5) Go "Settings -> Phone -> Call Blocking & Identification "

6) When I trying to enable my project, it's always show


----

Error Enabling Extension

The data provided by (My App Name) was invalid. You may try enabling the extension again, and if the problem persists contact the application developer.

----



Anyone encountered this problem too ?

Did you figure this out? Is there a NSUsagePermission... that needs to be added for Call Directory? I've had to add several of these with iOS 10.

The numbers in your identification array always should be in the right order


In this case you will see error:

CXCallDirectoryPhoneNumber phoneNumbers[] = { 28885555555, 18885555555 }


but in this case it will work correctly:

CXCallDirectoryPhoneNumber phoneNumbers[] = { 18885555555, 28885555555 }

The contacts must be in alphabetical order..

Wow, thanks very much! Wonder, why it's not documented?

Seems you have missed some handling in CallDirectoryProvider. For instance in my case I had called context.removeAllIdentificationEntries() without checking if it isIncremental. There might some similar case in your code as well.

call directory extension - error enabling extension
 
 
Q