How to intercept "Messages" sent from the CallKit incoming call screen?

I am using iOS 10 CallKit to receive incoming calls. Calls in my application do not come from "phone numbers" or "email addresses", but from the internal identifier in my protocol. Thus, I report incoming calls with CXHandleType CXHandleTypeGeneric (and not CXHandleTypePhoneNumber or CXHandleTypeEmailAddress ), using the user string as the "value" of the handle.

When I report an incoming call and the phone is not blocked, the user sees an incoming call screen with the buttons "Remind me", "Message", "Reject" and "Accept". If the user presses the "Message" button and selects one of the message lines in the next menu, he tries to send this line as a text message through the "Messages" application, the goal being the user line, which I used as the "value" of the call descriptor, as if it would be a phone number or email address, although it is not. Usually this leads to the fact that the message cannot be sent due to an invalid recipient, but depending on the line, it can actually send a valid address to which the user did not want to send; both results are bad.

I am looking to see if there is a way so that the message is not sent through the Messages application (which is always incorrect in my case), but is instead transferred to my application so that I can send the message to the caller correctly through my internal protocol.


Update: Remind me and Message buttons no longer appear on iOS 10.1

+5
source share
2 answers

iOS 10.1 Beta 1 changed this behavior so that it no longer shows the Remind or Message buttons for CallKit VoIP applications, so I recommend that you re-test the application using this beta.

If you want incoming calls from your application to continue to show the "Message" button, but for your application you can receive a message request instead of the "System Messages" application, please file an error with Apple to request this feature.

+1
source

The Message button appeared if SiriKit is supported on iOS 12. (add INSendMessageIntent in the INSendMessageIntent intent)

How to intercept:

  1. Run the intent extension
  2. Deal with handler(for intent:)
0
source

All Articles