本文介绍了如何拦截“消息”从CallKit来电屏幕发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS 10的CallKit接收来电。我的应用程序中的呼叫不是来自电话号码或电子邮件地址,而是来自我的协议中的内部标识符。因此,我使用 CXHandleType CXHandleTypeGeneric 报告来电:(而不是 CXHandleTypePhoneNumber CXHandleTypeEmailAddress ),使用自定义字符串作为句柄的值。

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.

更新:提醒我和消息按钮不再出现在iOS 10.1上

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

推荐答案

iOS 10.1 Beta 1已将此行为更改为不再显示CallKit VoIP应用的提醒我或消息按钮,因此我建议您使用该Beta操作系统重新测试您的应用。

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.

这篇关于如何拦截“消息”从CallKit来电屏幕发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 16:16