Quantcast
Channel: Ignite Realtime : Unanswered Discussions - Support
Viewing all articles
Browse latest Browse all 4979

Please help to send message

$
0
0

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 =======

<message to='174@my-host' id='yh5AC-13' type='chat'><body>abc</body><from xmlns='180@my-host/Smack'></from><to xmlns='174@my-host'></to></message>

 

======> 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 =========

<message to='180@52.74.143.241' from='174@52.74.143.241/3927037751429954977528087' type='chat'><body>ho</body><thread>0d1d716a-9ab7-49b8-b82c-d73bd5a16223</thread ><type_chat xmlns='jabber:client'></type_chat><from xmlns='jabber:client'></from><to xmlns='jabber:client'></to></message>

 

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


Viewing all articles
Browse latest Browse all 4979

Trending Articles