3

On an app to app call with using SinchCallKit demo app that is provided in the latest version (3.12), if the caller hangs up an ongoing call by calling [SINCall hangup] before the callee answers, the CallKit UI won't be removed from the callee's lock screen. It stays there forever.

So my question is here that how can we remove the CallKit lock screen UI from the callee's screen automatically. Is this is a server side issue or Apple handles this via push notifications?

aytek
  • 1,842
  • 24
  • 32

2 Answers2

2

Perform an EndCallAction. You need the ID number you used to create the call object initially.

// Where you handle your call disconnect
CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:call.callKitUUID];
CXTransaction *transaction = [[CXTransaction alloc] init];
[transaction addAction:endCallAction];
[self requestTransaction:transaction];

Here's the supporting -requestTransaction method:

- (void)requestTransaction:(CXTransaction *)transaction {
[self.callController requestTransaction:transaction completion:^(NSError * _Nullable error) {
    if (error) {
        SCILog(@"Error requesting transaction: %@", error.localizedDescription);
    } else {
        SCILog(@"Requested transaction successfully");
    }
}];
}
KevinS
  • 598
  • 4
  • 18
  • Thanks @KevinS, I tried this code before but I got this error. `The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction error 4.)`, meaning, the ID is wrong. I think something wrong with the Sinch SDK. – aytek Oct 21 '17 at 23:39
  • @vivektakrani hey, this was a Sinch SDK bug, they fixed the issue, please see the accepted answer. If you are not using the Sinch SDK, then this page is not the correct place for you I'm afraid. – aytek Sep 03 '18 at 18:05
  • Hey @aytek, thanks for your reply, I am using the latest Sinch SDK 3.12.5, but the issue still persists. Also as far as I understand CallKit UI is independent of Sinch SDK, so should it really cause any such issue? – vivek takrani Sep 04 '18 at 07:23
  • Hey @vivektakrani I used 3.12.1 and it works fine now. Any chance to try that version? Yes you are right, CallKit UI belongs to Apple but Sinch SDK manages it. – aytek Sep 05 '18 at 20:33
  • Hey @aytek, It's working fine now, had to call reportCallWithUUID method when the above method throws an error. Thanks for your time :) – vivek takrani Sep 06 '18 at 09:11
2

It is a bug in the Sinch SDK and it has been fixed since 3.12.1, please update to the latest version and give it a try.

Bo Li
  • 181
  • 6