I wanted to create account on my XMPP server (ejabberd); which is being created successfully via the following code:
XMPPTCPConnectionConfiguration conf= XMPPTCPConnectionConfiguration.builder()
.setServiceName(SERVICE)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setDebuggerEnabled(true)
.build();
XMPPTCPConnection connection = new XMPPTCPConnection(conf);
try {
connection.connect();
AccountManager accountManager = AccountManager.getInstance(connection);
accountManager.sensitiveOperationOverInsecureConnection(true);
Map<String, String> map = new HashMap<>();
map.put(“username”, user);
map.put(“password”, password);
map.put(“email”, email);
accountManager.createAccount(user, password, map);
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
But how to know when the account is created successfully or not? Is there any callback? I didn’t find any, so I am asking this question here.
I want to user to navigate to next screen when account is created successfully but unable to do so since I don’t know if account is created or not.