Creating new user with Smack on ejabberd throws XMPP Exception: forbidden(403)

前端 未结 4 1082
感动是毒
感动是毒 2021-01-05 11:10

Hi I am working on ejabberd and I am quite new to this technology.

I am trying to add a user on my ejabberd server using this code:

  try {                  


        
4条回答
  •  感动是毒
    2021-01-05 11:42

    I want to update the answer to reflect the change in Asmack library version 4.0 onward. Connection.getAccountManager() is now AccountManager.getInstance(XMPPConnection)

    AccountManager accountManager=AccountManager.getInstance(connection);
    try {
        accountManager.createAccount("username", "password");
    } catch (XMPPException e1) {
        Log.d(e1.getMessage(), e1);
    }
    

提交回复
热议问题