asmack XMPP new user registration

后端 未结 7 1356
鱼传尺愫
鱼传尺愫 2021-02-04 20:50

Good people of StackOverflow, please help. I\'ve set up an ejabberd server on my ubuntu machine, added virtual host, set {access, register, [{allow, all}]}. and registered

7条回答
  •  鱼传尺愫
    2021-02-04 21:12

    To register a new user using smack library after logging in through admin or some other account.

    /** * To Register a New Client On Jabber Server */

    public void registerUser()
    {
        AccountManager manager = connection.getAccountManager();
        try {
            manager.createAccount("Romain Guy","halejag");//username & paswd
    
    
        } catch (XMPPException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    

提交回复
热议问题