Good morning,
I have a problem wiht groups, I’m trying to make groups “re-join” work, without success.
What I do, is genral lines: Login --> launch joinGroups, and attach listeners --> jump to main activity. If app don’t loose connection, it works OK, but when it loose connectivity, then joing the group is not working. I try to send a message to group, and it return
Hola
I search about, it and I saw this problem was solven in Smack 4.2.X, but I still can make it work.
Some considerations: Rooms are not created from android client, are always created by server, or other client like iOS. and are supossed to be created without password., and general reconnection works OK, because is still possible to chat 1v1 .
Here is how I connect to room:
public void createGroupChat(EntityBareJid gJid){
MultiUserChat chatRoom = this.multiUserChatManager.getMultiUserChat(gJid);
try {
chatRoom.addMessageListener(new MessageListener() {
@Override
public void processMessage(Message message) {
connectResponse.newMessageReceived(new ChatMessage(message));
}
});
leaveGroupChat(gJid);
chatRoom.join(this.connection.getUser().getResourcepart());
} catch (XMPPException.XMPPErrorException | SmackException e) {
Logger.e(“ROOM:” + gJid + “\n” + e.getMessage());
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
I have forget somtehing?