Xamarin: Reload an iOS CallKit call directory extension from the app

I you want to make a call directory extension for iOS, for identifying or blocking certain phone numbers, you need a way to reload the extension every time you want to add or remove from the list of phone numbers you are blocking.

To reload the extension, you can either get your users to open their phone’s settings and disable the extension and re-enable it or you can reload it programmatically from your app.

To reload the extension manually, follow this procedure:

  1. Open the iPhone’s settings
  2. Go to “Phone”
  3. Go to “Identify phone numbers”
  4. Switch your extension off, then on again

To reload the extension programmatically from your app, use this code:

Here is Apple’s documentation for the error codes :
https://developer.apple.com/reference/callkit/cxerrorcodecalldirectorymanagererror.code/

The most common one I have come across is 6, Extension Disabled.

7 thoughts on “Xamarin: Reload an iOS CallKit call directory extension from the app”

    1. Extension disabled means you have to go into the phone’s settings and enable the extension.

      To enable the extension, follow this procedure:
      1. Open the iPhone’s settings
      2. Go to “Phone”
      3. Go to “Identify phone numbers”
      4. Switch your extension on

      You can not test CallDirectory extensions on a simulator, since the simulator doesn’t have phone capabilities. On a simulator, the extension will always disabled.

    1. In my other example, where I get the phone numbers from a file and then add them to the block list, I would need to reload the extension each time there are new phone numbers to add to the block list.

Leave a Reply

Your email address will not be published. Required fields are marked *