Display the system-calling UI for your app’s VoIP services and coordinate your calling services with other apps and the system using CallKit.

Posts under CallKit tag

73 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

After unholding CallKit, the audio does not restore.
In my application, I use CallKit and have supportsHolding = true set. During my phone call, another call comes in (e.g., GSM). I accept the incoming call and put the current call on hold. If I end the active call myself, everything is fine, and CallKit calls the method provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession). However, if the other party ends the call, the second call remains on hold. In the application, the user clicks on unhold, and I notify CallKit that the hold has ended. But in this case, the didActivate method is not called at all. If I try to activate the audio myself after unhold, I receive the error: Domain=NSOSStatusErrorDomain Code=561017449 "Session activation failed" UserInfo={NSLocalizedDescription=Session activation failed} AVAudioSessionErrorInsufficientPriority == NSOSStatusErrorDomain Code: 561017449 What needs to be done for CallKit to activate my audio?
1
1
546
Mar ’24
CXCall hasConnected is true when a call is declined or ignored
I'm working with CXCallObserver and before iOS 17, CXCall.hasConnected was only true if the user accepted the incoming phone call. Now it seems that in iOS 17 that declining or ignoring the incoming phone call also sets CXCall.hasConnected to true. I've also noticed that when the call is declined or ignored, CXCall.hasEnded doesn't get set to true until the person calling hangs up (either before or after leaving a voicemail). I need to know how to differentiate between an accepted, declined, or ignored phone call in iOS 17. Does anyone have any advice? Thanks
1
0
383
Mar ’24
Problem with PushKit/CallKit on iOS 15.8.x when iOS SDK 17.x is used
I am facing a strange problem with PushKit/CallKit when compiling with SDK 17.x. The app behaves normally on iOS 16 and iOS 17 devices but PushKit does not seem to work properly anymore with VoIP Push messages. The behavior is as follows: when the screen is unlocked, everything works as expected (app gets automatically started when not running and the call notification is displayed) when the screen is locked and the app is already running, everything works as expected (CallKit call screen is shown) when the app is not running and the screen is locked, nothing happens... but as soon as I unlock the screen the app gets started and CallKit can be informed about the call. After this the call notification is properly displayed. In the logs of the app I can see that the app didn't get started/informed about the VoIP Push notification before unlocking the screen Now the second problem is: as iOS doesn't start the app properly when the screen is locked, the app can't display the call via CallKit. Because of that the app will get blacklisted after a while (and for a while). Before using iOS SDK 17 the app was working without any issues on iOS 15 devices. Is this a known issue?
3
0
466
Mar ’24
CallKit : VOIP call is disconnecting when external call is declined
Hi, I have implemented VOIP calling feature in my application using OpenTok SDK and CallKit framework. Calling feature is working most of the time. But there is one strange issue I have come across. During a call, if any external cellular call appears and if I decline that external call then my running voip call also disconnects. This is happening some of the iPhone devices. iPhone config: Model: iPhone 11 iOS Version: 17.3 I have added loggers CXEndCallAction and -provider:performEndCallAction and debugged at my end. I found that CXEndCallAction is not executing from my end but still -provider:performEndCallAction is triggered by iOS along with my ongoing callUUID. This is very strange behaviour I am observing in one of my iPhone device. I have tested this in 4 iPhone devices but i am facing this issue only in 1 iPhone. Thanks,
0
0
394
Mar ’24
CallKit : VOIP call is disconnecting when external call is declined
Hi, I have implemented VOIP calling feature in my application using OpenTok SDK and CallKit framework. Calling feature is working most of the time. But there is one strange issue I have come across. During a call, if any external cellular call appears and if I decline that external call then my running voip call also disconnects. This is happening some of the iPhone devices. iPhone config is as follows Model : iPhone 11 iOS Version : 17.3 I have added loggers CXEndCallAction and -provider:performEndCallAction and debugged at my end . I found that CXEndCallAction is not executing from my end but still -provider:performEndCallAction is triggered by iOS along with my ongoing callUUID This is very strange behaviour I am observing in one of my iPhone device. I have tested this in around 3-4 iPhone devices but i am facing this issue only in 1 iPhone . Kindly help me here if anyone has solution around it . Thanks
0
0
322
Mar ’24
Can i do cellular call from my iOS app without user interaction and send message to particular number without user interaction in iOS swift.
My requirement is here- 1- We need to implement functionality in my iOS app to do call (cellular call) without user interaction. 2- We need to implement functionality in my iOS app to send normal message to particular phone number without user interaction. 3- Fetch OS log (NOT MY APPLICATION LOG). we need to fetch OS log when cellular call going on in device this log need to collect in my iOS app for identify the network strength and other things like call is connected and disconnect etc. Thanks
1
0
467
Mar ’24
Interruption-Level in VoIP Push
Hello, I would like get advice about the time-sensitive notification ‘interruption-level’ set to ‘time-sensitive’ in the push payload. I’m wondering if this setting applies to VOIP push notifications. I tried to find information in Apple’s documentation, but it doesn’t specify whether it is applicable for VOIP push notifications. { "aps": { "interruption-level": "time-sensitive" } } https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification#:~:text=ContentIdentifier%[…]terruption%2Dlevel,-String
0
0
364
Mar ’24
Callkit pannel Video button gray out
When use callkit, video button in callkit pannel is abnormal. Here are some case: iOS117 & incoming call: video button disable iOS17 & outgoing call: video button disable iOS16 & incoming call: video button enable iOS16 & outgoing call: video button disable will appricate for help! Core code: private func configureCallKit() { let configuration = CXProviderConfiguration(localizedName: "CallkitTesting") configuration.supportsVideo = true // 是否支持视频通话 configuration.supportedHandleTypes = [.generic] configuration.maximumCallGroups = 1 configuration.maximumCallsPerCallGroup = 1 provider = CXProvider(configuration: configuration) provider.setDelegate(self, queue: nil) } func startOutgoing() { let handle = CXHandle(type: .generic, value: "!!!!!!") let startCallAction = CXStartCallAction(call: UUID(), handle: handle) let transaction = CXTransaction(action: startCallAction) CXCallController().request(transaction) { error in if let error = error { print("Error requesting transaction: \(error.localizedDescription)") } else { print("Transaction requested successfully") } } }
1
1
352
Mar ’24
VOIP Call Notification
Hi Team, We are facing issues about VOIP call for some users in USA who used the Wi-Fi network of some service provider. They are not receiving the calls on Wi-Fi but able to receive the call when connected to SIM/Data Connection. We implemented the VOIP services of apple and VOIP notification received and call kit UI displayed. Its working fine on public network mostly but not working on some Wi-Fi network in USA. iPhone 12 Latest iOS version VOIP notification not received Call kit not display App Name=> Owwll
0
0
412
Mar ’24
iOS Callkit system screen, no audio if I wait for connection before calling CXAnswerCallAction::fulfill
I'm trying to integrate Callkit into a Flutter app that uses webRTC for calls and I have an issue with taking calls on locked screen. CXAnswerCallAction requires to have the action.fulfill() method called after the connection is established. Here is a pice of code without waiting for establishment of the connection: guard let call = self.callManager?.callWithUUID(uuid: action.callUUID) else{ action.fail() return } call.data.isAccepted = true self.answerCall = call self.callManager?.updateCall(call) sendEvent(SwiftCallKeepPlugin.ACTION_CALL_ACCEPT, call.data.toJSON()) DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1200)) { self.configureAudioSession() } action.fulfill() } This causes the connection time counter to be immediately visible on the screen, but the user still has to wait for connection establishment and can't hear anything. Here is the code that waits for the establishment of the connection before calling action.fulfill(): if(self.awaitedConnection.uuid != uuid) { action.fail() } else if(self.awaitedConnection.isConnected) { DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1200)) { self.configureAudioSession() } action.fulfill() } else { DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1000)) { self.waitForConnection(uuid: uuid, action: action) } } } public func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) { guard let call = self.callManager?.callWithUUID(uuid: action.callUUID) else{ action.fail() return } call.data.isAccepted = true self.answerCall = call self.callManager?.updateCall(call) self.awaitedConnection.uuid = action.callUUID self.awaitedConnection.isConnected = false sendEvent(wiftCallKeepPlugin.ACTION_CALL_ACCEPT, call.data.toJSON()) waitForConnection(uuid: action.callUUID, action: action) } Unfortunately, though it works great on iOS 15.7, on 17.3 it causes lack of audio, no sound and no recording. I also can't enable it later when the call is ongoing. For reference: let session = AVAudioSession.sharedInstance() do{ try session.setCategory(AVAudioSession.Category.playAndRecord, options: AVAudioSession.CategoryOptions.allowBluetooth) try session.setMode(self.getAudioSessionMode(data?.audioSessionMode ?? "voiceChat")) try session.setActive(data?.audioSessionActive ?? true) try session.setPreferredSampleRate(data?.audioSessionPreferredSampleRate ?? 44100.0) try session.setPreferredIOBufferDuration(data?.audioSessionPreferredIOBufferDuration ?? 0.005) }catch{ print(error) } } I can see in the docs of action.fulfill() that "You should only call this method from the implementation of a CXProviderDelegate method". I this the reason for the issue? But how can I do it if I need to wait for the connection asynchronously and the provider method is synchronous?
1
0
534
Mar ’24
Voip Push Delay Issue
Hello, I am developing a service using Voip Push. Recently, it seems that Voip Push notifications are occasionally arriving late. Does anyone have information regarding this issue? Sometimes, when the delay is prolonged, notifications from a few days ago also seem to be received. Thank you.
0
0
332
Feb ’24
PushRegistry didReceiveIncomingPushWith is not invoked sometimes and the call doesn't happen
I have been having a problem in our application while handling the VoIP notifications. sometimes the didReceiveIncomingPushWith delegate function is invoked when a VoIP Notif is sent but when the call is accepted nothing happened from the caller's side, like the callback to the caller to notify him that the call is accepted doesn't happe. And sometimes the didReceiveIncomingPushWith is not even invoked when a VoIP notif is sent. here is a potion of the code. func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { NSLog("pushRegistry didReceiveIncomingPushWith() type:(type)") // Handle the push payload if let pushHashtable = payload.dictionaryPayload["aps"] as? [AnyHashable: Any] { if let pushMessage = pushHashtable["alert"] as? String { NSLog("push message=\(pushMessage)") } } if type == PKPushType.voIP { // Process the received push: if it is a VoIP push, this must be an incoming call because we deactivated push for REGISTER refresh from Kamailio server if SipService.instance?.currentCall != nil { // A call is already going on, ignore this VoIP push NSLog("pushRegistry - voip push, and we already have a currentCall: we already received the INVITE, or it is a voip push for another call -> let's ignore it") completion() return } // We want to send a REGISTER anyway to get the pending INVITE message. // Then, the incoming call will be notified in the SIP stack onCallNew(_ call: Call!) callback // Since iOS 13, it is mandatory to report an incoming call immediately after a Voip push // instead of waiting for the SIP INVITE (in EngineDelegate.onCallNew()) // See details here: https://forums.developer.apple.com/message/376630#376630 NSLog("pushRegistry - >= iOS 13 -> showing callkit before SIP INVITE") if let callerSipUri = payload.dictionaryPayload["caller-sip-uri"] as? String { NSLog("push caller-sip-uri=\(String(describing: callerSipUri))") SipUtils.findCallerName(fromSip: callerSipUri) { callerName in let customCallerName = (callerName ?? "Inconnu") + (CallKitService.instance?.CALLKIT_DEBUG_MODE == true ? " [PUSH]" : "") DispatchQueue.main.async { CallKitService.instance?.reportNewIncomingCallToCallKit(callerName: customCallerName) { completion() } } } } else { // That should not happen: Kamailio server is supposed to add the caller SIP URI in the VoIP push DispatchQueue.main.async { CallKitService.instance?.reportNewIncomingCallToCallKit(callerName: nil) { completion() } } } // No call is going on, so we want to take this call, so we want to send a REGISTER if needed SipNetworkMonitoring.instance.start() } else { NSLog("pushRegistry - not a VoIP push") completion() } } here is the reportNewIncomingCallToCallKit function implementation func reportNewIncomingCallToCallKit(callerName: String?, completion: @escaping () -> Void) { NSLog("Callkit - reportNewIncomingCallToCallKit from %@", callerName ?? "Inconnu") let update = CXCallUpdate() update.remoteHandle = CXHandle(type: .generic, value: callerName ?? "Inconnu") update.hasVideo = true // we may already have reported a new call to CallKit // (since iOS13, we must do it in the didReceiveIncomingPushWith() callback) // In this case, the CallKit UI is already showing with caller="Inconnu": we will update it with the caller name. if let currentUuid = currentUuid { NSLog("Callkit - already a CallKit call showing -> updating the existing call ...") self.cxProvider?.reportCall(with: currentUuid, updated: update) } else { NSLog("Callkit - now CallKit call showing -> new call ...") let newUuid = UUID() self.currentUuid = newUuid self.cxProvider?.reportNewIncomingCall(with: newUuid, update: update) { error in completion() } } // dont configure audioSession here, wait for the Callkit "didActivate audioSession" callback } just to clarify : findCallerName is a function to get the called name from a list from the Backend with an escaping closure, (I tried to overpass that function and just give a default name to the caller but still same problem) . ANY HELP PLEASE?
0
0
514
Feb ’24
Receive (Local) System Notifications
Hi. I would like my App to be notified when the phone rings. No, not CallKit-CallKit is for VoIP and does not cover Cellular connections (as of 2/26/24) but, thanks. To continue.. I understand ages-ago there was a Telephony Kit or Framework but, has been discontinued. Has it been replaced with something else? I would like something that seems very simple:a) when the phone rings my App is notified, b) when it stops ringing (combine all possibilities; sent to voicemail, user cancels, user answers) my App is notified. Yes, I understand UserNotifications can make things run but, as I understand it this feature is for the App to schedule notifications, not receive them? If you know of something in UserNotifications that I can leverage I would appreciate your input. Lacking other possibilities I find myself wondering about Siri integration. Siri is notified about system events and generates notifications based upon these events. Is there some way to place my App downstream from Siri and receive system notifications? Thanks everyone.
2
0
534
Feb ’24
CallKit Video button disabled
I have integrated CallKit successfully and I'm trying to handle the video button. In some devices, I get the enabled video button and can request to open a video connection. But for some devices, I get a disabled video icon. What could be the reason for that? private lazy var provider: CXProvider = { let configuration = CXProviderConfiguration() configuration.supportsVideo = true configuration.maximumCallGroups = 2 configuration.maximumCallsPerCallGroup = 4 configuration.includesCallsInRecents = false configuration.supportedHandleTypes = [.generic] return CXProvider(configuration: configuration) }() func reportIncomingCall() { let uuid = UUID() let update = CXCallUpdate() update.supportsGrouping = true update.supportsHolding = true update.remoteHandle = CXHandle(type: .generic, value: "Name") update.hasVideo = true // or false provider.reportNewIncomingCall(with: uuid, update: update) { [weak self] error in // handle } } Note: Whatsapp has the enabled video button in the same device.
2
0
604
Feb ’24
Resetting categoryOptions when setting the mode in Swift AVAudioSession
When setting the mode during the configuration of an audio session in Swift, the previously configured categoryOptions get reset. For example, if you perform setMode as shown below, you will observe that all previously set categoryOptions are cleared. Example: try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .videoChat, options: [.allowBluetooth, .defaultToSpeaker]) try AVAudioSession.sharedInstance().setMode(.voiceChat) If you need to change the mode while maintaining the categoryOptions, you have to perform setCategory once again. Although the exact reason for this behavior has not been identified, the practical impact on the application's functionality is not yet clear. Why do you think this handling is in place?
0
0
450
Feb ’24
CallKit VOIP end reason
When there is an ongoing call, if the user gets another one, we don't want to support multi-call and directly send the new call to the voicemail. For this operation what should be CXCallEndedReason? My understanding is that remoteEnded is used when the call connected and then ended. unanswered might be the choice for me but would it cause any issue if i directly reject a call with this status (the difference between the incoming call and reject time would be too short)? There is also declinedElsewhere , which might be suitable
0
0
455
Jan ’24