This manager automatically adds message delivery requests to outgoing messages, if enabled. If a message has been received by the recipient, registered listeners will be notified about the receipt.
If an incoming message contains a delivery receipt request, a receipt is automatically sent back to the requesting entity.
Note that messages must contain an id, in order to track receipts. If a message does not contain an id, requests won't be added.
MessageDeliveryReceiptsManager messageDeliveryReceiptsManager = xmppSession.getExtensionManager(MessageDeliveryReceiptsManager.class); messageDeliveryReceiptsManager.addPubSubListener(new MessageDeliveredListener() { {@literal @}Override public void messageDelivered(MessageDeliveredEvent e) { System.out.println("Message delivered: " + e.getMessageId()); } });
|
|