【发布时间】:2014-09-10 12:36:27
【问题描述】:
我正在开发一个简单的聊天应用程序。
我可以同时与多个用户聊天,但我的问题是 我无法向其他用户显示“正在输入...”状态。
我提到了这个链接How to get typing status notification in XMPP,但有帮助:(
我们将不胜感激。
my sample code:
String text = textMessage.getText().toString();
String to = recipient.getText().toString();
Log.i("Composing=>", "Sending text " + text + " to " + to);
Message msg1 = new Message(to, Message.Type.chat);
msg1.setFrom("user1@192.168.0.98"); // my id
MessageEventManager event=new MessageEventManager(connection);
//recipient id
event.sendComposingNotification("tech1@192.168.0.98",msg1.getPacketId());
如果我在浏览器中聊天,那么它工作正常,我可以看到状态“正在输入” 当其他用户在他的窗口中输入时。
【问题讨论】:
-
XEP-22 消息事件已过时。尝试改用 XEP-85 聊天状态通知。有关 Smack API 的相关信息,请参阅igniterealtime.org/builds/smack/docs/latest/javadoc/org/…