App icon is not showing in CallKit interface

I have configured my provider for CallKit iOS. In which I also set ' iconTemplateImageData strong>' to display the application icon in the CallKit UI. But the app icon is not displayed. He shows a white square box.

enter image description here

Vendor configuration code:

    CXProviderConfiguration *configuration = [[CXProviderConfiguration alloc] initWithLocalizedName:[NSString stringWithFormat:@"%@\n", _title]];
    configuration.maximumCallGroups = 1;
    configuration.maximumCallsPerCallGroup = 1;
    UIImage *callkitIcon = [UIImage imageNamed:@"AppIcon"];
    configuration.iconTemplateImageData = UIImagePNGRepresentation(callkitIcon);

    _callKitProvider = [[CXProvider alloc] initWithConfiguration:configuration];
    [_callKitProvider setDelegate:self queue:nil];

    _callKitCallController = [[CXCallController alloc] initWithQueue:dispatch_get_main_queue()];

      

I used AppIcon images in Images.xcassets ' with dimensions: - 1x: 40 * 40, 2x: 80 * 80, 3x: 120 * 120

Please help why my app icon is not showing.

Thanks in advance.

+3


source to share


1 answer


This is most likely because you are using an AppIcon image which is a fully opaque image, i.e. no part of this image is transparent or has alpha = 0.



To get the desired effect, you must use another image that is partially (or mostly) transparent. The native UI in the call will only use the alpha channel of the image you provide, so it ignores colors. I offer an example in Speakerbox sample app and provide a secondary PNG image in your image asset directory with transparency.

+1


source







All Articles