asmack XMPP new user registration

后端 未结 7 1378
鱼传尺愫
鱼传尺愫 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:21

    Works for me this code to register a new account:

    try
    {
        connection.connect ();
        Log.i (TAG, "Connect");
        mAccount = new AccountManager (connection);
        if (mAccount.supportsAccountCreation ())
        {
            mAccount.createAccount ("user", "pass");
        }
    

    with the following settings ejabberd:

    {access, register, [{allow, all}]}.

    It is a very secure setup because it can record without our authenticated accounts on the server (the method supports.AccountCreation () returns us true).

提交回复
热议问题