Please help to send message

I developing on Android with Smack 4.1.0. But I have a problem while sending message between Android and iOS

====== My code =====

Message message = new Message(to, Message.Type.chat);

message.setFrom(from);

message.setBody(text);

message.addExtension(new DefaultExtensionElement(“from”, from));

message.addExtension(new DefaultExtensionElement(“to”, to));

connection.sendStanza(message);

========= I log my message =======

abc

======> But message.getFrom() always return null. So my ios app can not parse content, and not know who sent it.

======== My ios app send a message below, Android app received =========

ho0d1d716a-9ab7-49b8-b82c-d73bd5a16223<type_chat xmlns=‘jabber:client’></type_chat>

=======> With the message from iOS, I can know who sent it

Smack does strip the ‘from’ attribute in order to minimize the data put on the wire as servers are required to ignore the from attribute send by clients and replace it with the full JID anyways. So this should not affect you in any way. But there is also AbstractXMPPConnection (Smack 4.1.0 API)