How to intercept "Messages" sent from CallKit incoming call screen?
Asked Answered
A

2

7

I'm using iOS 10's CallKit to receive incoming calls. The calls in my app do not come from "phone numbers" or "email addresses", but from an internal identifier in my protocol. I thus report incoming calls with the CXHandleType of CXHandleTypeGeneric (and not CXHandleTypePhoneNumber or CXHandleTypeEmailAddress), using a custom string as the "value" of the handle.

When I report the incoming call, and the phone is not locked, the user sees an incoming call screen, with the buttons "Remind Me", "Message", "Decline", and "Accept". If the user presses the "Message" button, and selects one of the message strings on the following menu, it tries to send that string as a text message through the Messages app, with the destination being the custom string I used as the "value" of the handle of the call, as though it were a phone number or email address, even though it isn't. This usually causes the message to fail to send due to an invalid destination, but, depending on the string, it might actually send to a valid destination the user did not want to send to; both outcomes are bad.

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


Update: the "Remind Me" and "Message" buttons no longer appear on iOS 10.1

Askance answered 23/9, 2016 at 20:55 Comment(3)
have resolve the this case? , else how can we hide the Message/Remind Me buttons.Euxenite
Can I open my custom app on answering the phone call? Please know me since I don't have iOS development experience. But curious to know this.Eczema
"Message" button has appeared if support SiriKit. (add INSendMessageIntent to info.plist in Extension)Aldwon
A
5

"Message" button has appeared if support SiriKit in iOS 12. (add INSendMessageIntent to intent's info.plist)

How to intercept:

  1. Run the Intent Extension
  2. Deal with handler(for intent:)
Aldwon answered 10/4, 2019 at 3:10 Comment(0)
P
0

iOS 10.1 Beta 1 has changed this behavior to no longer show the 'Remind Me' or 'Message' buttons for CallKit VoIP apps, so I encourage you to re-test your app using that Beta OS.

If you would like the ability for incoming calls from your app to continue showing the 'Message' button but for your app receive the message request instead of the system's native Messages app, please file a bug with Apple to request this capability.

Photosensitive answered 24/9, 2016 at 17:7 Comment(4)
Can I open my custom app on answering the phone call from native screen? Please know me since I don't have iOS development experience. But curious to know this.Eczema
If the device is locked when an incoming call arrives via a CallKit app and the user answers, the device will remain in the native incoming call UI since the device is still locked and iOS cannot launch the app in the foreground. However if the device is already unlocked when an incoming call arrives, the user will be taken directly to the app once the call is answered.Photosensitive
the user will be taken directly to the app once the call is answered You mean my VoIP app which is calling the call screen right? I've checked fb messenger. On click of video button when the call screen appears, user is taken to fb messenger video call screen. Means we can override the buttons on the call screen? I'm not from iOS background. So please let me know about these queriesEczema
Can you answer my query over this question https://mcmap.net/q/1625015/-ios-can-i-open-my-voip-app-on-answering-call-using-callkit/4512651Eczema

© 2022 - 2024 — McMap. All rights reserved.