Search code examples
iosswiftphone-call

Receiving phone calls in Swift iOS


Is there any way to receive a phone calls from App and decline it by sending sms progmatically? Or receive calls and then switch on autospeaker?

Pseudo code of what i want be like:

    if (someone is calling) {
       if (someone = Father) {
           autoReply("Dad, i'm on the meeting. Will call you back in 1 hour")
       }
    }

There is a lot of information about how to do a phone call, but much less about receiving it. Any response will be appreciated!

Sorry for my perhaps silly question :) I'm newbie in iOS Swift Development.


Solution

  • Unless you are working on a jailbroken app, this is not possible in any way.
    You have to understand that iOS development is limited by Apple's restrictions and guidelines. All apps are sandboxed and can't affect the system's behavior in any way (excepted through iOS public API's, and none of them offers hook up to phone call events).