专业IM即时通讯软件开发,值得信赖!

xmpp openfire+Smack OutgoingChatMessageListener 监听不到

openfire 云聊IM 194℃
//这一句至关重要 否则OutgoingChatMessageListener监听不到消息
mConnection.setFromMode(XMPPConnection.FromMode.USER);

chatManager.addOutgoingListener(new OutgoingChatMessageListener() {
    @Override
    public void newOutgoingMessage(EntityBareJid messageTo, Message message, Chat chat) {
        Log.d(TAG, "OutgoingChatMessageListener");
        Log.d(TAG, "message.getBody() :" + message.getBody());
        Log.d(TAG, "message.getFrom() :" + message.getFrom());
        Log.d(TAG, "message.getType() :" + message.getType());
    }
});
喜欢 (0)
仿微信聊天软件开发
点击这里给我发消息