8

CallKit's call directory extension can be used to block standard phone calls. However how is blocking a VoIP call supposed to work with iOS 13?

When there is a VoIP call your app receives a VoIP push, but now with iOS 13 Apple are mandating that when the push is received the app must call CXProvider.reportNewIncomingCall().

However when reportNewIncomingCall() is called, the OS displays an incoming call screen (which is not the same as for a regular incoming call). It is apparently not possible for this call screen to be suppressed, and even if reportNewIncomminCall() is invoked with a parameter which is a number which has been registered as blocked with the CallKit extension, the call screens still being displayed.

So it would seem it is impossible for an application to offer the ability to block a VoIP phone call (unless the app sends its list of blocked numbers to the server, and the server doesn't send the push for a particular handset for blocked numbers. But if the app is installed in hundreds of thousands or millions of handsets, that's a large undertaking on the server side to implement).

Marco
  • 1,572
  • 1
  • 10
  • 21
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
  • 3
    iOS 13 is still beta, so I would submit feedback to Apple. The documentation for `reportIncomingCall` suggests that VoIP calls should be altered by directory extensions. Maybe it's a bug. – Paulw11 Jul 01 '19 at 19:58
  • @Paulw11 occasionally Apple respond to postings on their developer forum, but the majority of the time they don't. So while waiting for a possible response from them, was additionally posting here wondering if any SO readers had some insight. – Gruntcakes Jul 01 '19 at 20:06
  • 2
    Sure, butt you should definitely use the beta feedback tool as well as develeoper forums and SO. – Paulw11 Jul 02 '19 at 02:33
  • Did you check the CXProvider delegate method and see if you could catch the incoming call and block it from there? https://developer.apple.com/documentation/callkit/cxproviderdelegate – Mikael Jul 10 '19 at 05:30
  • @mikael. AFAICT those delegates do not get called before reportNewIncomingCall() has to be called. The problem is not actually blocking the call, the problem is stopping iOS from displaying the Voip incoming call screen. The call might get blocked, but the OS will still display the incoming call screen as soon as reportNewIncommingCall() is called. Thus misleading the user. – Gruntcakes Jul 10 '19 at 19:43
  • Ok very interesting detail here. Looking forward for the answer to that question. – Mikael Jul 11 '19 at 06:44

1 Answers1

7

I had some correspondence with an Apple Voip engineer. Apple are expectingthat if you need to block Voip calls then you need to do it on the server, not the handset.

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378