我正在使用 Xmpp 协议在 smack api.n 的帮助下创建聊天应用程序,用户可以与其他人聊天。但是用户无法接收离线消息。但是如果用户有多个离线消息,则会收到消息.
什么解决方案?
ConnectionConfiguration config = new ConnectionConfiguration(Constants.CHAT_SERVER,Constants.CHAT_SERVER_PORT,Constants.CHAT_SERVER_DOMAIN);
config.setSASLAuthenticationEnabled(false);
connection = new XMPPConnection(config);
try
{
connection.connect();
Log.i("XMPPClient", "[SettingsDialog] Connected to " + connection.getHost());
}
catch (XMPPException ex)
{
Log.i("XMPPClient", "[SettingsDialog] Failed to connect to " + connection.getHost());
}
connection.login(userName, password);