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

83 Posts
Sort by:
Post not yet marked as solved
0 Replies
358 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
by
Post not yet marked as solved
2 Replies
386 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
by
Post not yet marked as solved
2 Replies
455 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
by
Post not yet marked as solved
0 Replies
355 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
by
Post not yet marked as solved
0 Replies
220 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
by
Post not yet marked as solved
0 Replies
343 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
Post not yet marked as solved
0 Replies
362 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
Post not yet marked as solved
1 Replies
627 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
Post not yet marked as solved
1 Replies
371 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
Post not yet marked as solved
0 Replies
443 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
Post not yet marked as solved
0 Replies
320 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
by
Post not yet marked as solved
0 Replies
301 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
Post not yet marked as solved
0 Replies
357 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
Post not yet marked as solved
0 Replies
306 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
by
Post not yet marked as solved
0 Replies
399 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
by
Post not yet marked as solved
0 Replies
490 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
Post not yet marked as solved
0 Replies
373 Views
iOS 17 enables video call "Reactions" by default and this is not appropriate for our app that uses CallKit for video calls. Is there an option we can utilise to disable this functionality for our app?
Posted
by
Post not yet marked as solved
0 Replies
497 Views
In the app, I have VOIP functionality along with AVPlayer for playing videos from remote URLs. Once a VOIP call is established, AVPlayer gets AVPlayerRateDidChangeReasonSetRateFailed right after AVPlayerRateDidChangeReasonSetRateCalled in AVPlayer.rateDidChangeNotification observer when trying to start a video using the play() method. As a result, the video does not start. Checked AVAudioSession.interruptionNotification, it is not getting fired. AVPlayer functionality works as expected before and after the call. Issue observable on iOS 17 only. Any help would be appreciated.
Posted
by
Post not yet marked as solved
0 Replies
442 Views
Hi, I have an application that blocks entry calls from commercial companies (using CallKit) and since the iPhone 15 release I have a lot of people that they have problems activating the extension in Settings - Phone - Block ID Calls (all people have an iPhone 15 with any version), I download Xcode15 and the last versions of iOS 17 (including betas) and in my iPhone14 Pro I can't reproduce this error, in the settings simulator, the option doesn't exist, I don't know what happened, and I can't find any information about this problem. Has anyone had problems like this? Thanks in advance.
Posted
by