简体   繁体   中英

iOS Private API Method for Placing a Call Without Displaying the MobilePhone App?

I know that I can place a call using CoreTelephony's CTCallDialWithID. I also know that I can hang up with CTCallDisconnect. I am wondering how I can possibly initiate a call and then hang it up without displaying the MobilePhone app. I suspect it can be done, but I'm really stretched thin on this one because I'm not seeing anything obvious in either CoreTelephony or the MobilePhone app's headers.

Creker makes me believe it's possible in this unanswered duplicate from last year, but I have not been able to find anything resembling help on the subject, so I am turning to you. I am currently targeting iOS 8.1, but code to accomplish it for any iOS SDK would be of tremendous help to me.

Thanks!

see CTCall

To initiate a call without using MobilePhone, you can use the CTCallDial function.

CFStringRef number = CFSTR("15555555555");

CTCallRef call = CTCallDial(number);

/* Hold call */
CTCallHold(call);

/* Resume call */
CTCallResume(call);

/* End call */
CTCallDisconnect(call);

Note : The phone number passed to CTCallDial must be normalized. For example, +1 (555) 555-5555 will become 15555555555 after normalization.

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