The xml that i need to receive is :
<message id="qm5Dx8" to="adsfxcv" type="chat"from="adsf"
msgType="2"
thumbnail="randomThumbnail"
serverMediaURL="random"
isFromMe="1"
status="1"><body>Image</body><request xmlns='urn:xmpp:receipts'/></message>
Message is being sent by MyCustomMessage extends Message class.
In my message listener, Where i need to get the packet is :
public void processPacket(Packet packet) {
String recivedPacket = packet.toXML();
try {
if (packet instanceof MyCustomMessage) {
MyCustomMessage msg = (MyCustomMessage) packet;
....
But I am receiving only id,to,type and from in message tag. And the instance of packet is also of Message and it says , cannot cast packet to message. plz guide me how can i receive my desired packet.