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

84 Posts
Sort by:
Post not yet marked as solved
0 Replies
86 Views
Hello, I'm trying to test a call in the Simulator using CallKit. However, after the CXStartCallAction of CallKit is called, the CXEndCallAction is immediately invoked. I conducted the test using Xcode 15.2 and iOS 17.2 Simulator. When I searched because I couldn't test it on the Simulator, I found a similar issue on the following link. https://stackoverflow.com/questions/78291725/callkit-invokes-cxendcallaction-after-starting-the-call-resulting-in-hangup-on The person who asked the question in the link tested it with the previous version iOS 15.5 Simulator and it worked fine. Why isn't it working in the latest version? Is it a bug? Or has the policy been updated? If there are any documents available to check regarding this matter, please share them.
Posted Last updated
.
Post not yet marked as solved
0 Replies
179 Views
I am using Xcode Version 15.3 (15E204a) and different versions of Simulator runtimes (17.x, 16.x, 15.0) The app makes outgoing calls and can respond to incoming calls. After starting the call, ~2s pass before a hangup occurs. In the Console logs I see that CXEndCallAction was invoked by CallKit and the last suspicious log before invoking the CXEndCallAction is callservicesd Disconnecting call because there wont be a UI to host the call: <CSDProviderCall 0x107054300 type=PhoneNumber, value=sdsddsdds, stat=Sending tStat=0, model=<TUCallModel 0x103f661e0 hold=1 grp=1 ungrp=1> ... This used to work before, but since upgrading to Xcode 15 and iOS 17.x it happens constantly on simulator versions 17.x, and sometimes on 16.x, whereas I wasn't able to reproduce it on 15.0 version. Can someone help me understand why this happens and how to fix it? I provided some logs down below, and I don't see similar logs in the cases when the call is okay and CallKit doesn't hangup it. Also, this does not happen on real devices From the time CXStartCallAction is invoked until the CallKit invokes CXEndCallAction, these are some of the error or warn logs that appear: callservicesd -AVSystemController- +[AVSystemController sharedInstance]: Failed to allocate AVSystemController, numberOfAttempts=3 callservicesd [WARN] +[AVSystemController sharedAVSystemController] returned nil value callservicesd [WARN] Not allowing requested start call action because a call with same UUID already exists callWithUUID: (omitted) callservicesd Error while determining process action for callSource: (omitted) callservicesd Determined that callSource: <CXXPCCallSource 0x103d060a0, ...>, should process action: <CXStartCallAction 0x107232760 UUID=8D34853F-55DD-4DEC-97A7-551BFD27C924, error: Error Domain=com.apple.CallKit.error.requesttransaction Code=5 "(null)" callservicesd [0x103e417a0] invalidated after the last release of the connection object callservicesd [WARN] No paired device, so unable to send message UpdateCallContext callservicesd FaceTime caller ID (null) is not a valid outgoing relay caller ID callservicesd Attempting to find a valid outgoing caller ID in set of available outgoing caller IDs {( )} callservicesd Could not automatically select an outgoing caller ID; multiple telephone numbers are listed in the set of available outgoing caller IDs {( )} callservicesd Adding call <CSDProviderCall 0x107054300 ...> to dirty calls pool callservicesd Entitlement check: ... entitlementCapabilities={( "access-call-providers", "modify-calls", "access-call-capabilities", "access-calls" )}> lacks capability 'access-screen-calls' callservicesd [WARN] ... but no dynamic identifier could be found (1) or no handoff user info exists (1). Not broadcasting frontmost call error com.apple.CallKit.CallDirectoryUnable to initialize CXCallDirectoryStore for reading: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." ... {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} The logs provided are in order in which they are logged, but some of them are recurring After these logs there is still a message that CXStartCallAction is fullfilled: callservicesd Start call action fulfilled: <CXStartCallAction 0x107231fe0 UUID=8D34853F-55DD-4DEC-97A7-551BFD27C924 ...> After which the last suspicious log is logged before CXEndCallAction is invoked by CallKit: Disconnecting call because there wont be a UI to host the call: <CSDProviderCall 0x107054300 ...>
Posted
by kemica.
Last updated
.
Post not yet marked as solved
2 Replies
165 Views
Hello, I am trying to develop an app , using Flutter. My app has its own database which it contains the customer info such as name, address and phone number. I need to get the caller's phone number then I use the phone number and search in my database and if the phone# exist in our DB , I extract customer info and show it on pop up screen. How can I get the phone number of the person who is calling? i tried this, it didnt work: let networkInfo = CTTelephonyNetworkInfo() guard let carrier = networkInfo.serviceSubscriberCellularProviders?.first?.value else { return nil } return carrier.mobileNetworkCode Is there any way to get caller's number while he/she is calling? Thanks P.
Posted
by snoopy6.
Last updated
.
Post not yet marked as solved
0 Replies
184 Views
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?
Posted Last updated
.
Post not yet marked as solved
1 Replies
165 Views
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
Posted
by eric.dang.
Last updated
.
Post not yet marked as solved
0 Replies
183 Views
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?
Posted
by nappsoft.
Last updated
.
Post not yet marked as solved
0 Replies
169 Views
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,
Posted Last updated
.
Post not yet marked as solved
0 Replies
134 Views
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
Posted Last updated
.
Post not yet marked as solved
1 Replies
205 Views
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
Posted Last updated
.
Post not yet marked as solved
1 Replies
216 Views
Dear Appple Dev Team, we have developed an app to identify incoming phone calls via CallKit (https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontext). This function works great. However, we are missing a similar function for SMS/iMessage sender identification. Is it possible to integrate this function into iOS. Thanks Markus
Posted Last updated
.
Post not yet marked as solved
0 Replies
172 Views
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
Posted
by sundee.
Last updated
.
Post not yet marked as solved
1 Replies
177 Views
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") } } }
Posted
by Sizhangli.
Last updated
.
Post not yet marked as solved
0 Replies
243 Views
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
Posted
by almas542.
Last updated
.
Post not yet marked as solved
1 Replies
258 Views
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?
Posted
by cand123.
Last updated
.
Post not yet marked as solved
0 Replies
199 Views
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.
Posted Last updated
.
Post not yet marked as solved
2 Replies
321 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
284 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
313 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
.