Hide FaceTime Button in CallKit UI

I am implementing CallKit support inside a VoIP application.

I managed to disable the video button by setting supportsVideoto falsein CXProviderConfiguration. Now the FaceTime button has appeared.

I wanted to know if there is a way to disable FaceTime in the user interface by default, since the application processes internal corporate numbers that have nothing to do with FaceTime.


Update : As indicated in the answers below, you can disable the button, but the caller’s number is lost (displayed as Unknown). I want to save the number and disable the FaceTime button.


Update : Disabling the FaceTime feature on the iPhone disables the FaceTime button. However, this is not an acceptable solution to the problem.


Update : Any type changes CXHandle, including inserting characters that are invalid for a phone number into it, do not affect the problem - the FaceTime button is still displayed.

+4
source share
4 answers

In a good news / bad news vein, I was able to turn off the FaceTime button by clearing remoteHandle(it didn’t delete or hide, it’s just inactive).

However, as a side effect, Caller appears as "Unknown" if you do not set the property localizedCallerNameto CXCallUpdate.
A call without a handle will have a side effect that cannot be pressed in Recents.

CXCallUpdate *callUpdate = [[CXCallUpdate alloc] init];
//callUpdate.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric value:handle];
[self.provider reportNewIncomingCallWithUUID:uuid update:callUpdate completion:^(NSError* error) {}];
+2
source

FaceTime, remoteHandle, @Eli Burke, Recents. , .

0

FaceTime, , " " , , FaceTime , . , Apple, .

edit: : CXHandle CXCallUpdate , , FaceTime , CXHandle. - CallKit - CXHandle, , , FaceTime .

0

- , remoteHandle , .

- , .

, /.

  • Init CXProviderConfiguration.

    let providerConfiguration = CXProviderConfiguration(localizedName: "yourConfigName")
    providerConfiguration.supportsVideo = supportsVideo
    providerConfiguration.supportedHandleTypes = [.generic, .phoneNumber, .emailAddress] // Pick your own supportedHandleTypes.
    
  • remoteHandle .

    let update = CXCallUpdate()
    
    // Set hasVideo so it shows correct type on incomingCall screen.
    update.hasVideo = supportsVideo
    
    // Exclude remoteHandle so that the FaceTime button is disabled
    // update.remoteHandle = CXHandle(type: .generic, value: yourHandle)
    
  • Important! Refresh the remote interface when the call ends in the delegate func provider(_ provider: CXProvider, perform action: CXEndCallAction).

Excluding remoteHandle when reportIncomingCall loses the ability to call from the system call log. But you can update the call and configure it right before the call ends.

 func provider(_ provider: CXProvider, perform action: CXEndCallAction) {
    let update = CXCallUpdate()

    // Set the remoteHandle, so you can call from System Call History
    update.remoteHandle = CXHandle(type: .generic, value: yourHandle)
    provider.reportCall(with: uuid, updated: update)

    action.fulfill()
} 
0
source

Source: https://habr.com/ru/post/1664315/


All Articles