Message send failed callback?

Hi,

I’m using smack 4.1.9 I simply want to know if my message successfully send to xmpp server or failed.

I send message with this code

try {

chat.sendMessage(message);

} catch (SmackException.NotConnectedException e) {

e.printStackTrace();

}

I am cathcing only if I am connected to server. How can I listen server if my message sended (Like one tick state in whatsapp) or how can I get error response if there is any error.

Hi you can do it with message receipt mechanism

I have configured my server and rebuilded for it.

you can send receipts from server as you get message on server so when you get response receipts from server you can easily say your message is delivered to server. On user side they need to send delivered receipts to user so that you can say your message is received by other user and same concept used for read receipts.

for sending receipts you can mention packet id in receipts so that you will get which message is delivered to server or user.

hope you will get my concept…