如何使用smack获取邮件传递状态?

时间:2017-04-27 06:49:34

标签: android xmpp kotlin smack

发送消息时请求发送状态

 var message:Message = Message()
            message.addBody("EN",msg_text.text.toString())
            Log.i("Delivery Request id ",DeliveryReceiptRequest.addTo(message))

            Log.v("Chat Response msg ",chat.send(message).toString())

DeliveryReceiptListener

//投递状态收件人

var deliveryReceiptManager= DeliveryReceiptManager.getInstanceFor(connection)
        deliveryReceiptManager.autoReceiptMode = DeliveryReceiptManager.AutoReceiptMode.always
        deliveryReceiptManager.autoAddDeliveryReceiptRequests()
        deliveryReceiptManager.addReceiptReceivedListener { fromJid, toJid, receiptId, receipt ->

            Log.i("From jid ",fromJid.toString())
            Log.i("To jid ",toJid.toString())
            Log.i("Receipt id  ",receiptId.toString())
            Log.i("recipt ",receipt.toString())

        }

我无法获得交付状态,即收到读取/未读/消息。我将如何实现这一目标?

0 个答案:

没有答案