Send XMPP (Smack) Message

时间秒杀一切 提交于 2019-12-06 03:47:43

Turns out the answer to this problem was something that was just overlooked.

In the first line of code:

 chat = chatmanager.createChat(username, new MessageListener() {
            public void processMessage(Chat chat, Message message) {}
      });

I didn't make the variable "username" have the proper IP extension. So it was merely "A" instead of "A@123"

Moving "sendUsername" to the top and Changing "username" to "sendUsername" makes everything work great :)

Silly mistake.

Using IP addresses is almost always more confusing than you think it is.

There's a good chance you have OpenFire misconfigured, so that the IP address isn't a valid hostname. Go into the admin console, under "System Properties", and make sure that the xmpp.domain property is set to your IP address.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!