I am using OpenFire with aSmack.
I can't seem to get DeliveryReceipts services to work.
I do the following when I create the connection:
connection.login(username, password);
DeliveryReceiptManager.getInstanceFor(connection).enableAutoReceipts();
DeliveryReceiptManager.getInstanceFor(connection).addReceiptReceivedListener(new ReceiptReceivedListener()
{
@Override
public void onReceiptReceived(String arg0, String arg1, String arg2)
{
Log.v("app", arg0 + ", " + arg1 + ", " + arg2);
}
});
I am sending a message to another user using:
Message msg = new Message(id, Message.Type.chat);
msg.setBody(chat);
DeliveryReceiptManager.addDeliveryReceiptRequest(msg);
connection.sendPacket(msg);
The above does not work, although the message is sent with ReceiptRequest. The listener does not start at the end of the sender, although the receiver receives the message. (I confirmed this with debugging that the DeliveryReceiptRequest application is really tied to the message being sent).
I also tried manually sending back the receipt using the following in my PacketListener (MessageTypeFilter (Message.Type.chat)):
Packet received = new Message();
received.addExtension(new DeliveryReceipt(packet.getPacketID()));
received.setTo(packet.getFrom());
getConnection().sendPacket(received);
, . - ?