Swift 4 iMessage发送消息:操作无法完成。 (com.apple.messages.messagesapp-error错误9.)

时间:2017-06-16 18:26:03

标签: swift xcode imessage

发送邮件时,会使用随机代码抛出错误。没有描述或任何东西。这是我的代码:

       if #available(iOSApplicationExtension 11.0, *) {
            conversation?.send(message, completionHandler: { (error) in
                if error != nil {
                    print(error?.localizedDescription)
                }
            })
        } else {
            conversation?.insert(message, completionHandler: { (error) in
                if error != nil {
                    print(error?.localizedDescription)
                }
            })
        }

错误:无法完成操作。 (com.apple.messages.messagesapp-error错误9。)

使用插入功能时,它工作正常。真的烦我哈哈,明白吗?错误......不是吗?确定。

1 个答案:

答案 0 :(得分:0)

在Apple的beta文档中找到错误代码: https://developer.apple.com/documentation/messages/msmessageerrorcode/2909031-sendwithoutrecentinteraction 显然,该应用程序需要用户在发送之前进行交互(我的应用程序有),但由于某种原因,它仍会触发它。