2

A project I'm working on works mainly around a good UI/UX. The one issue I'm facing is answering calls on a locked iOS device.

Documentation:

Apple introduced the CallKit and PushKit features to allow access to the native call screen which is good, but not ideal in my case.

There is good literature on both of these components, e.g.

Previously asked?

There are many questions about this issue, mostly centered around 2 years ago, which is why I am asking again.

Some extra CallKit/PushKit tutorials

The issue is non of these, as far as I have read, provide a mechanism to open an app directly after answering.

Viable solutions

The only way to do this with the current implementation is to use the last of the 6 buttons on the CallKit screen (optionally with an AppIcon), see image [Masked Image Icon]:

enter image description here

Examples:

Question:

I can't find any solution to open my iOS (Flutter app) when answering a VoIP call from a locked state - is this at all possible?

CybeX
  • 2,060
  • 3
  • 48
  • 115
  • I am facing same problem did you found any solution for your question? – Asad Farooq Nov 29 '21 at 06:38
  • 1
    This isn't possible due to the CallKit used by iOS - this is simply they way they've implemented any and all call answering to standardize it across apps see Discord, WhatsApp, etc – CybeX Nov 30 '21 at 07:35
  • 1
    On whatsapp after answering call app automatically open how it's possible during locked mode? – Asad Farooq Nov 30 '21 at 12:03
  • On Android yes, just tested and confirmed it is not the case with iOS. the CallKit is used and goes the the screen shown above. To go to WhatsApp, you have to press the Masked image icon (6th button) – CybeX Nov 30 '21 at 15:10

1 Answers1

2

I don't know if you still need the solution, but for the sake of others finding this question: I found the answer in another Stackoverflow post.

Link: iOS CallKit. Jump directly to application

I am copying the answer here for clarity (credits go to 0awawa0) Note that the code example is in Swift.

So apparently, if you set. hasVideo property to true for your
CXCallUpdate when reporting the call, system will automatically open your application when call is accepted. Anyway, this feature is not mentioned anywhere in the documentation. Or, at least, I can not find anything about it.

Here is the part of my code that reports new call now:

let update = CXCallUpdate()
update.remoteHandle = CXHandle(type: .generic, value: handle)
update.hasVideo = true // <- was false earlier, setting to true did the trick
update.supportsDTMF = false
update.supportsHolding = true
update.supportsGrouping = false
update.supportsUngrouping = false

callProvider.reportNewIncomingCall(with: uuid, update: update, completion { error in     /*...*/ }