CallKit: iOS Integration - CXProviderConfiguration Not Working

1.5k views Asked by At

Having a problem with CallKit integration. I am creating a configuration like this:

    let providerConfiguration = CXProviderConfiguration(localizedName: "XXX")

    providerConfiguration.supportsVideo = false
    providerConfiguration.maximumCallsPerCallGroup = 1
    providerConfiguration.supportedHandleTypes = [.phoneNumber]

    if let callKitIcon = UIImage(named: "IconMask")
    {
        providerConfiguration.iconTemplateImageData = callKitIcon.pngData()
    }

    providerConfiguration.ringtoneSound = "Ringtone.caf"

And then creating the provider like so:

self.provider = CXProvider(configuration: providerConfiguration)
self.provider.setDelegate(self, queue: nil)

Problem is that all of this seems to be ignored. Custom Ringtone does not sound, IconMask does not show up on the iOS UI (its just a blank). IconMask is correct and the 3 images are 40, 80 and 120 pixels with alpha channel. Ringtone.caf is a valid sound file copied in the bundle.

Nothing in this CXProviderConfiguration seems to have any impact at all. Very frustrating! I get called back on the delegate function:

func providerDidBegin(_ provider: CXProvider)

And there I can inspect provider.configuration and it all looks correct. What am I doing wrong?

The inbound call actually works and I am integrating with TwilioVoice and VOIP push. So just the UI is not picking up anything in the configuration.

1

There are 1 answers

0
devdoe On

Can you check if both ringtone and icon file have the targetMembership selected for them in the FileInspector enter image description here