简体   繁体   中英

Is it possible with CallKit Framework to make, answer and end telephonic call or is it used for VOIP call only?

I want to perform the action on telephonic calls with the help of CallKit, but as per Apple documentation, it can be used to make VOIP calls only, is there any way through which I can make outgoing calls, end the current call and answer incoming telephone calls with the help of CallKit.

I am using private framework (TelephonyUtilities), trying to do the above mentioned activities.

NSBundle *bundlePath = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/TelephonyUtilities.framework"];
 if ([bundlePath load]) {   
    Class TUCallCenter = NSClassFromString(@"TUCallCenter");
    id tuCallCenter = [TUCallCenter sharedInstance];
}

But none of TUCallCenter methods allow me to initiate telephony call from my app. Although there are defined methods available. Some of which are :

- (id)_dial:(id)arg1 callID:(int)arg2 service:(int)arg3 sourceIdentifier:(id)arg4 dialType:(int)arg5 uniqueProxyIdentifier:(id)arg6;
- (id)_dialWithRequest:(id)arg1 completion:(id /* block */)arg2;
- (id)callWithCallUUID:(id)arg1;
- (id)callWithStatus:(int)arg1;
- (id)callWithUniqueProxyIdentifier:(id)arg1;
- (id)callsWithStatus:(int)arg1;
- (id)dial:(id)arg1 callID:(int)arg2 service:(int)arg3;
- (id)dial:(id)arg1 callID:(int)arg2 service:(int)arg3 sourceIdentifier:(id)arg4 uniqueProxyIdentifier:(id)arg5;
- (id)dial:(id)arg1 service:(int)arg2;
- (id)dialEmergency:(id)arg1;
- (id)dialEmergency:(id)arg1 sourceIdentifier:(id)arg2;
- (id)dialWithRequest:(id)arg1;
- (void)dialWithRequest:(id)arg1 completion:(id /* block */)arg2;

CallKit

Display the system-calling UI for your app's VoIP services, and coordinate your calling services with other apps and the system.


Overview

CallKit lets you integrate your calling services with other call-related apps on the system. CallKit provides the calling interface, and you handle the back-end communication with your VoIP service. For incoming and outgoing calls, CallKit displays the same interfaces as the Phone app, giving your app a more native look and feel. And CallKit responds appropriately to system-level behaviors such as Do Not Disturb.

In addition to handling calls, you can provide a Call Directory app extension to provide caller ID information and a list of blocked numbers associated with your service.

Receiving an Incoming Call

Receiving an incoming call method straight forward leads to PushKit silent notification which used in VOIP apps.

// MARK: PKPushRegistryDelegate
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
    // report new incoming call
}

So, there is no chance of using CallKit apart from VOIP apps.

https://developer.apple.com/documentation/callkit

Hope this helps to understand scenario.

Not without a jailbreak ( EDIT : Or without using a private framework, for a privately released app) I'm afraid.

CallKit is meant to make your VoIP calls appear on the Phone app, like these ones here. CallKit的一个例子 CallKit can also make a call of your VoIP app appear just like a stock Voice Call to the user.

What you're looking for, requires a private framework instead, but in that case you're either coding for a jailbroken release, or a private release for your client. To do so, you need to look into TelephonyUtilities.framework probably. Check it out here . TUCall seems to be a call object through which you can get the details or end it, while TUCallCenter has an incomingCalls method. So this can indeed work, just in a private release, not an App Store app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM