6
votes

Can I implement groupchat like WhatsApp or BBM in XMPP Asmack? I'm using Openfire Server. I already implemented the basic multiuserchat in XMPP (http://xmpp.org/extensions/xep-0045.html), but it's not contain all the features that i needed.

I need the full features of group chat like :

  • groups can persist user no matter if they are online or not.
  • deliver offline messages to a group member (when he comes online).

Should I customize the server? or there are any Standard about this group feature? I really need help for this problem.

Thank you.

1
@Richard, Have you found the solution? I am also looking the same functionality. Please reply. Thanks in advance...Jagdish

1 Answers

-1
votes

You should use a packet listener for group chat messages. Run this packet listener in a service so that group chats are update even when the app is not running in foreground. Then check the sender id from packet and update your data base accordingly. Check the code below.

PacketFilter filter = new MessageTypeFilter(Message.Type.groupchat);
            yourXmppConnection.addPacketListener(new PacketListener() {

                @Override
                public void processPacket(Packet packet) {
                    Message message = (Message) packet;
                    String received_message=message.getBody();
                    String from_user=message.getFrom();

                        // Add incoming message to the list view or similar
                    }
                }
            }, filter);