I have read the question about making a-non-voip-call and it seems, that the open url is the only way to do it. Since CoreTelephony is deprecated, is it possible to use Callkit to get the call states when making a call with open url? If not is there any way to get the call states programmatically? I am developing an in-house-app.
How can CallKit be used to make a non-voip call?
Thanks in advance!!
Apple's CallKit is a framework introduced with iOS 10. It gives users the ability to handle VoIP calls from third party apps, such as Skype, similar to how they would handle a system phone call.
The way to implement this is with PushKit. Go to the Apple Developer website, and login. Create an App ID, and make sure to specify the Bundle ID and check Push Notifications . Create a new certificate and select VoIP Services Certificate .
CallKit integrates VoIP services with other call-related apps on the Apple device, using the same native interface, making it easier for users as they use the same dialer for all calls. However, it's not plain sailing and CallKit does have its limitations.
To get call states in CallKit, you can use CXCallObserver in your app.
import CallKit
final class ProviderDelegate: NSObject, CXCallObserverDelegate {
var callObserver: CXCallObserver!
func setupCallObserver(){
callObserver = CXCallObserver()
callObserver.setDelegate(self, queue: nil)
}
func callObserver(_ callObserver: CXCallObserver, callChanged call: CXCall) {
if call.hasEnded == true {
print("CXCallState :Disconnected")
}
if call.isOutgoing == true && call.hasConnected == false {
print("CXCallState :Dialing")
}
if call.isOutgoing == false && call.hasConnected == false && call.hasEnded == false {
print("CXCallState :Incoming")
}
if call.hasConnected == true && call.hasEnded == false {
print("CXCallState : Connected")
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With