AnsweredAssumed Answered

Account manager callback?

Question asked by Deepak on Mar 7, 2017
Latest reply on Mar 7, 2017 by Deepak

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.

Outcomes