Maybe I was late to answer this question, but I would like to share my solution here, I had the same problem,
First of all, it depends on which version of smack you are using (I recommended the latest version)
Secondly, the user sending the MUC invitation and inviting the user to the invitation must be connected to the same server in order to receive the MUC invitation.
The third always allows the smack debugger, it will provide information about the incoming and outgoing stanza.
The fourth factor you should consider is to send your presence to the XMPP server after logging in, as shown below,
connection.setStatus(true,"ONLINE"); public void setStatus(boolean available, String status) throws XMPPException { Presence.Type type = available? Type.available: Type.unavailable; Presence presence = new Presence(type); presence.setStatus(status); connection.sendPacket(presence); }
sending a presence informs the xmpp server about the status of the user, and then the presence information, as well as a new invitation, will be received if you turned on the listener on the connection object, this works for me, I hope it will work for you too, please correct me if any information is wrong.
source share