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

CallKit Documentation

Posts under CallKit tag

85 Posts
Sort by:
Post not yet marked as solved
2 Replies
349 Views
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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
320 Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
341 Views
Hi, We are developing an infotainment system that includes a wireless CarPlay. Can someone confirm the expected behavior when a device connected via wireless car play should do in the below scenario. iPhone connected through wireless car play and projection is active in he CarPlay projection a call is going on. Car play gets disconnected when user switches off the WiFi. After these steps , should the call only continue on the phone or should the connected get transitioned to HFP ( Hands free profile) and call continue though the head unit in the car. Do note, WiFi is switched OFF in phone so CarPlay can't restart without user switching it back ON
Posted
by Hari004.
Last updated
.
Post not yet marked as solved
2 Replies
422 Views
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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
335 Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
210 Views
I am trying to obtain the phone number of an incoming call or retrieve the last caller's number in my iOS app, but I'm facing challenges. CallKit only seems to provide access to a call's UUID and not the actual phone number. Is there a way to get the caller's phone number using CallKit or any other method in iOS?
Posted Last updated
.
Post marked as solved
3 Replies
771 Views
Hi! On iOS 16 CallKit for some reason will not ring over 60s. func reportNewIncomingCall(with UUID: UUID, update: CXCallUpdate, completion: @escaping (Error?) -> Void) After receiving a VoIP call push, I have reported it as soon as possibile. Expected result: Will ring always. Actual result: Stop after 60s
Posted
by eden_qu.
Last updated
.
Post not yet marked as solved
0 Replies
322 Views
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
Posted
by Btay.
Last updated
.
Post not yet marked as solved
3 Replies
1.9k Views
I took delivery of my first M1 Mac (iMac running Big Sur 11.4) and with great anticipation installed my iOS VoIP App from the AppStore. I was greatly disappointed to see that There were no VoIP Pushes to start an incoming call Callkit does not seem to work so I get no Audio. Am I missing something? Is there some permissions or configuration I might need to set? Or is it just that Callkit and Pushkit don't work even though it states on developer.apple.com that they are supported on macOS 10.15+ Any advice or guidance greatly appreciated. Very disappointed :-(
Posted
by davemaj.
Last updated
.
Post not yet marked as solved
1 Replies
540 Views
i have an issue when handling silent push in my app when the user close the app, here is my native code which works like charm when the app in the foreground, background or terminated status from a short time from closing the app, and after long time from closing it (+30min) it will not work anymore, it make me confuse why it does not work and other messaging app like viber, whatsapp and messanger you can still receive messages and calls even you swipe the app and close it !! is there any thing must i add !! override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { Messaging.messaging().appDidReceiveMessage(userInfo) if Auth.auth().canHandleNotification(userInfo) { completionHandler(.noData) return } // sample notification for testing let content = UNMutableNotificationContent() content.title = "Hi there" content.body = "Just test" content.sound = UNNotificationSound.default let request = UNNotificationRequest(identifier: "helloNotification", content: content, trigger: nil) UNUserNotificationCenter.current().add(request) { (error) in if let error = error { print("Error adding notification request: \(error.localizedDescription)") } } // resent to dart side let controller: FlutterViewController = window?.rootViewController as! FlutterViewController let notificationChannel = FlutterMethodChannel(name: "notificationHandler", binaryMessenger: controller.binaryMessenger) var dataToSend: [String: Any] = [:] if let text = userInfo["text"] as? String { dataToSend["text"] = text } // Convert the dictionary to NSDictionary let nsDataToSend = NSDictionary(dictionary: dataToSend) // Pass the NSDictionary to Dart notificationChannel.invokeMethod("handleRemoteMessage", arguments: nsDataToSend) } i checked : background capabilities : remote notifs, background fetching, voip, background processing
Posted
by devops07.
Last updated
.
Post not yet marked as solved
1 Replies
356 Views
:( We are currently in the process of developing a video calling app using WebRTC. We initiate one-to-one video calls with the AVAudioSession configured as follows: do { if audioSession.category != .playAndRecord { try audioSession.setCategory( AVAudioSession.Category.playAndRecord, options: [ .defaultToSpeaker ] ) try audioSession.setActive(true, options: .notifyOthersOnDeactivation) } if audioSession.mode != .videoChat { try audioSession.setMode(.videoChat) } } catch { logger.error(msg: "AVAudioSession: \(error.localizedDescription)") } After initiating a video call, we recorded this app's video call using the iOS default screen recording feature. As a result, the recorded video includes system audio. However, iOS/iPad apps with similar features (Zoom, Skype, Slack) do not include audio in their recordings. Why does this difference occur? Is this behavior a security feature of iOS, and are there specific conditions required? Is there a need for some sort of configuration in AVAudioSession? additional :( I also reached out to Apple Developer Technical Support, and they responded, "We were able to reproduce it, but since we don't understand the issue, we will investigate it." What's that about...
Posted
by soejima.
Last updated
.
Post not yet marked as solved
0 Replies
422 Views
Hi, Some of my iOS test devices do not receive PushKit notification anymore. I request and receive a VoIP token at app startup, then register it. I report any incoming PushKit notification directly to CallKit on the same thread. But some devices do not receive the PushKit/VoIP notification (app in foregroud or in background). They used to. Some other devices are receiving it with the same code, for a successful call. I tried reinstall and device restart with no success. I can see on the problematic devices at app startup in the console: callservicesd XPC PushKit connection invalidated from client <private> before seing: callservicesd Registering client process <private> with bundle identifier <private> for PushKit voip in environment <private> I could not find anything on "PushKit connection invalidated from client", anyone knows what triggers it? Thanks.
Posted
by md_td.
Last updated
.
Post not yet marked as solved
0 Replies
300 Views
Hello! I'm a developer working on developing a telephony service using VoIP. I've been keeping records of calls, but I've noticed some strange behavior. I'm wondering if anyone has experienced similar issues and if there are any solutions. Currently, the setting includesCallsInRecents is set to true. The issues I'm encountering are as follows: Check the records after a voice call. Check the records after a video call. Check the records after another voice call. During the third step, I observed that all records of the second video call disappeared. Does anyone have any insights or assistance regarding this issue? After conducting another video call and checking again, I noticed that previous video call records are displayed along with the new ones. However, when I conduct a voice call, the records disappear again. I'm wondering if this is an operating system bug or if there's a specific place I can check to investigate. Any information would be greatly appreciated!
Posted Last updated
.
Post not yet marked as solved
0 Replies
288 Views
When I am receiving incoming call I need to update localizedCallerName in CallKit. As of iOS 17.2, localizedCallerName does not change. Is there anything I need to specify to update the name? Looks like the problem is related to CXCallUpdate() This is the code I use for updating caller name: func updateCallerName(_ call: Call) { let update = CXCallUpdate() update.localizedCallerName = call.localizedCallerName provider.reportCall(with: call.uuid, updated: update) }
Posted
by ULTARI.
Last updated
.
Post not yet marked as solved
0 Replies
334 Views
CallKit is not get updated on iPhone 14 with Dynamic Island When I am receiving incoming call I need to update localizedCallerName in CallKit. As of iOS 17.2, localizedCallerName does not change. Is there anything I need to specify to update the name? Looks like the problem is related to CXCallUpdate() This is the code I use for updating caller name: func updateCallerName(_ call: Call) { let update = CXCallUpdate() update.localizedCallerName = call.localizedCallerName cxProvider.reportCall(with: call.uuid, updated: update) }
Posted
by ULTARI.
Last updated
.
Post not yet marked as solved
0 Replies
291 Views
The crash 0xbaadca11 seems to happen with PushKit and CallKit usage. I/we understand that as and when we receive voip push message from PushKit, we have to report the call to CallKit. However in some situations and data from payload (Like call with UUID already exists / payload decryption fails) where we are not supposed to report the call to user. The app gets crashed and further get blacklisted to get calls. Is there any way for developers to directly and silently report call failure to PushKit / CallKit.
Posted Last updated
.
Post not yet marked as solved
3 Replies
1k Views
In code: thread Queue: shared_tcpConnWorkQueue   libsp.dylib`spd_checkin_socket.cold.1:      0x242276464 &lt;+0&gt;:  adrp   x8, 137736      0x242276468 &lt;+4&gt;:  adrp   x9, 0      0x24227646c &lt;+8&gt;:  add    x9, x9, #0xa3f            ; "Linked against modern SDK, VOIP socket will not wake. Use Local Push Connectivity instead"      0x242276470 &lt;+12&gt;: str    x9, [x8, #0x390] 0x242276474 &lt;+16&gt;: brk    #0x1 -&gt; EXC_BREAKPOINT (code=1, subcode=0x242276474) DeviceLogs: Application Specific Information: Linked against modern SDK, VOIP socket will not wake. Use Local Push Connectivity instead   Thread 3 name:   Dispatch queue: shared_tcpConnWorkQueue Thread 3 Crashed: 0   libsp.dylib                          0x216566474 spd_checkin_socket.cold.1 + 16 1   libsp.dylib                          0x2165654c0 spd_checkin_socket + 896 2   CFNetwork                            0x1b4230ef0 0x1b40f2000 + 1306352 3   CFNetwork                            0x1b4232bcc 0x1b40f2000 + 1313740 4   CFNetwork                            0x1b42351e0 0x1b40f2000 + 1323488 5   CFNetwork                            0x1b42343a0 0x1b40f2000 + 1319840 6   libdispatch.dylib                    0x1b9e61850 _dispatch_call_block_and_release + 24 7   libdispatch.dylib                    0x1b9e627c8 _dispatch_client_callout + 16 8   libdispatch.dylib                    0x1b9e3d854 _dispatch_lane_serial_drain$VARIANT$armv81 + 604 9   libdispatch.dylib                    0x1b9e3e2e4 _dispatch_lane_invoke$VARIANT$armv81 + 380 10  libdispatch.dylib                    0x1b9e48000 _dispatch_workloop_worker_thread + 612 11  libsystem_pthread.dylib              0x1fa8e2b50 _pthread_wqthread + 284 12  libsystem_pthread.dylib              0x1fa8e267c start_wqthread + 8 I think it is due to voip socket issue. But not getting the point exactly. As am new to ios Development so do not have much idea. Looking forward for guidance. Thanks in advance!
Posted
by YR23.
Last updated
.
Post not yet marked as solved
0 Replies
382 Views
Our app has implemented the call directory extension. When we modify the order or switch on/off in call blocking and identification, there is no change reflected within the Phone app. We need to relaunch the Phone app for the changes to take effect correctly. Is this a bug in iOS 17?
Posted Last updated
.
Post not yet marked as solved
0 Replies
472 Views
We have an app using CallKit since it's been introduced and had to deal with different kind of CallKit bugs and/or behaviour changes after almost every new major iOS release. But we have no ideas what to do with issue we observing on iOS17. Some users report no audio on first OUTGOING call only after app started. Subsequent calls have audio. Logs showing everything is fine - Audio Category is set, AudioUnits did setup, CallKit did activate AudioSession, and app is transferring audio frames to/from AudioUnits. But no audio. We've got reproduced this on one of devices we have and was able to fix the issue by removing paired Hearing Aid configured on the device (however the Hearing Aid was never used with this device, just config for it was iCloud synced). But we don't have confirmation from other users that there is a dependency on Hearing Aid device paired. Did anyone hit this issue as well? Any suggestions than fill Bug Report that most likely will sit forever with Apple?
Posted
by Artem_XZ.
Last updated
.