I managed to do this by adding the following functions to the Smack BOSHConnection library class:
public class BOSHConnection extends Connection {
...
public String getSid() {
return client.getSid();
}
public Long getRid() {
return client.getRid();
}
...
}
, Rid - , Smack, .
Jid BOSHConnection.getUser();
, , , Smack, BOSHConnection.login.
public void login(String username, String password, String resource)
throws XMPPException {
login(username, password, resource, false);
}
public void login(String username, String password, String resource, boolean preBind)
throws XMPPException {
if (!isConnected()) {
throw new IllegalStateException("Not connected to server.");
}
... unchanged
authenticated = true;
anonymous = false;
if (preBind) {
return;
}
-
// login with pre-bind only
connection.login(userName, password, "", true);
, , , - , . , XMPP- ( SMACK ), , , XMPP, - , .
: fooobar.com/questions/1553122/...