【问题标题】:MSMessagesAppViewController didStartSending overridden method is not called on SEND button tapMSMessagesAppViewController didStartSending 在发送按钮点击时未调用覆盖方法
【发布时间】:2017-08-01 17:56:45
【问题描述】:

我创建了一个 iMessage 应用程序来发送从图像转换的 MSSticker。

我已经实现了以下重写方法:

override func didStartSending(_ message: MSMessage, conversation: MSConversation) {
        // Called when the user taps the send button.

    // Here I am adding rewards points on every sticker sending
    }

在 iOS 10.2.0 中,它运行良好意味着添加了奖励积分,但在更新到 10.2.1 后突然停止,现在我不再回调 didStartSending 方法,也没有调用 didCancelSending。

这是 iOS 10.2.1 的错误,还是我应该使用任何应用设置来通过上述方法获得通知?

任何帮助将不胜感激。

【问题讨论】:

标签: ios swift xcode imessage


【解决方案1】:

在新的更新中,您必须使用以下方法发送消息。如果你没有调用下面的方法,那么func didStartSending 将不会调用。

    func insert(_ message: MSMessage, 
completionHandler: ((Error?) -> Void)? = nil)

并检查以下内容

如果控制器的presentationStyle 属性为MSMessagesAppPresentationStyle.transcript,或者其presentationContext 属性为MSMessagesAppPresentationContext.media,则方法不会调用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-09
    • 2017-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多