22

Is it possible to write an application that will block incoming and outcoming phone calls? Or is the iPhone locked down too much? Thanks!

Chuck
  • 234,037
  • 30
  • 302
  • 389

5 Answers5

21

EDIT: See Rajan Maheshwari's answer below. CallKit now provides this. Even things that seemed they would never change, can change eventually.


Anything that modifies a user's ability to make or receive phone calls is going to run afoul of Apple's basic approach to third-party apps. There are a lot of things that are questionable and you might get away with. Blocking calls is clearly forbidden.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610
  • 2
    Thank you. That's what i was afraid of. –  May 19 '09 at 18:23
  • 20
    Why would you be afraid of that? What I would be afraid of is a software that prevents me from receiving calls. – Martin Cote May 19 '09 at 18:27
  • Could be that he accepted a project request from a client for something that blocks calls, not knowing the limitations. Bad call to not research before you leap though. Sorry – Organiccat May 19 '09 at 19:14
  • I just got a call from an Australian phone spam bank. I wish I could add that number to a blocking app. Seems like a legitimate use case and S60 phones have an app that does this, from what I hear. – Andrew Hedges Jun 02 '09 at 22:07
  • Call blocking is and should be handled by the carrier, not the phone. Any piece of it that should be handled by the phone (such as a convenient "add this recent call to my block list") needs to be handled by the phone system software, not a third party app. – Rob Napier Jun 03 '09 at 11:55
  • 3
    If all you want is to not hear some incoming calls, just add a 'silent' ringtone (there's plenty of instructions about how to add your own ringtones) and then assign that ringtone to the offending caller in your contacts list. – Michael Kohne Jul 09 '09 at 11:27
  • 5
    I would LOVE to be able to block specific phone numbers. Its my phone. Its my minutes. I pay the bill. When you get collections calling about accounts from some other person who either lied and gave our your number or previously had your number - you'd want that ability too. Bottom line is that I am paying and I should have the final say as to who can use my minutes up and who cant. – Taptronic Dec 25 '09 at 05:59
  • @Optimal, call your carrier. They can do this. – Mike Daniels Feb 25 '10 at 19:06
  • I tried Mike, AT&T told me they dont do that but to call them and they may remove minutes at their discretion. – Taptronic Feb 27 '10 at 04:32
  • I don't agree with this answer. iPhone makes it easy to make incorrect calls and some people would keep calling back. That's unwanted calls. Google "block unwanted calls" you will find out many discussions and cases. There are some applications available. – David.Chu.ca Apr 22 '10 at 19:46
  • 1
    See the callkit framework now which allows to block calls http://stackoverflow.com/a/40482909/2545465 – Rajan Maheshwari Nov 29 '16 at 18:07
6

It is now possible to detect and block unwanted phone calls from iOS 10 and above.

See the CallKit framework

The CallKit framework (CallKit.framework) lets VoIP apps integrate with the iPhone UI and give users a great experience. Use this framework to let users view and answer incoming VoIP calls on the lock screen and manage contacts from VoIP calls in the Phone app’s Favorites and Recents views.

CallKit also introduces app extensions that enable call blocking and caller identification. You can create an app extension that can associate a phone number with a name or tell the system when a number should be blocked.

Community
  • 1
  • 1
Rajan Maheshwari
  • 14,465
  • 6
  • 64
  • 98
2

It is possible in iOS 10.

Here's how to do it ->

1.Create a call directory extension enter image description here

2.Block the incoming call ->

class CustomCallDirectoryProvider: CXCallDirectoryProvider {
    override func beginRequest(with context: CXCallDirectoryExtensionContext) {
        let blockedPhoneNumbers: [CXCallDirectoryPhoneNumber] = [ phone Numbers here with country code! ]
        for phoneNumber in blockedPhoneNumbers.sorted(by: <) {
            context.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber)
        }

        context.completeRequest()
    }
}

Note: If you are using callKit to receive incoming calls then there is no need to manually block other calls.

Link -> https://developer.apple.com/reference/callkit

Kakshil Shah
  • 3,466
  • 1
  • 17
  • 31
2

A number of events will potentially interrupt an application - incoming call, SMS message or calendar alert. If the user ignores the interruption your application will continue running. If not, it will terminate.

See Apple docs for more details.

MikeJ
  • 542
  • 6
  • 19
0

An app has not access to the phone feature, and has no way to block a call.
The alternative is to wait for Apple to offer that feature in the future.

In the meantime, you can

  • Ask your provider - some providers do that
  • Create a custom ring tone (silent) to be associated to some number (no ring).
Déjà vu
  • 28,223
  • 6
  • 72
  • 100