Search code examples
swiftvoipaddressbook

How to disable the recommendation my app on contact info when using VoIP CallKit?


Can I disable or hide my app recommendations on contact info? more precisely, when long press the call/video button. I do not want to show my app on this actionSheet.

example image

Other apps like Discord, Slack(and so on) don't show this list, And I wonder how to do this.
Any comments will be very appreciated.


Solution

  • You need to set supportedHandleTypes to .generic for CXProviderConfiguration in-order to hide your app recommendations on contact info.

        let configuration = CXProviderConfiguration(localizedName: *YourAppName*)
        configuration.maximumCallsPerCallGroup = 1
        configuration.maximumCallGroups = 1
        configuration.supportedHandleTypes = [.generic]
    

    Then:

        var callProvider: CXProvider = CXProvider(configuration: configuration)
    

    When the telephony provider receives an incoming call or the user starts an outgoing call, the other caller is identified by a CXHandle object. For a caller identified by a phone number, the handle type is CXHandle.HandleType.phoneNumber and the value is a sequence of digits. For a caller identified by an email address, the handle type is CXHandle.HandleType.emailAddress and the value is an email address. For a caller identified in any other way, the handle type is CXHandle.HandleType.generic and the value typically follows some domain-specific format, such as a username, numeric ID, or URL.