How to end a call in CallKit

It is not a question of input code, it is a matter of feasibility. If I initiate a phone call using CallKit, is it possible to end it programmatically?

Thank.

+4
source share
2 answers

Yes, we can do it programmatically, but we must save the UUID for this call,

CXEndCallAction *endaction = [[CXEndCallAction alloc] initWithCallUUID:callUUID];
[cxcallcontrollerobject requestTransaction:[CXTransaction transactionWithActions:@[action]] completion:completion];

Hope this helps.

+7
source

When quickly using the following code, uuidCallKit is the UUID of the current call that I have with me.

let controller = CXCallController()
let transaction = CXTransaction(action: 
CXEndCallAction(call: uuidCallKit))controller.request(transaction,completion: { error in })
0
source

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


All Articles