xmpp - Registering User using Smack 4.1.3 -
we building chat client in java , using smack 4.1.3. noticed there huge change in smack apis after smack 4.0 , registrations examples available on internet not working smack 4.1.3. not getting write apis register user. may give sample codes. in advance...
this connects ejabberd server smack 4.1.3.
xmpptcpconnectionconfiguration config = xmpptcpconnectionconfiguration.builder() .setusernameandpassword("testuser", "pass") .setservicename("example.com") .sethost("example.com") .setresource("test") .setsecuritymode(xmpptcpconnectionconfiguration.securitymode.disabled) .setport(5222) .build(); saslmechanism mechanism = new sasldigestmd5mechanism(); saslauthentication.registersaslmechanism(mechanism); saslauthentication.blacklistsaslmechanism("scram-sha-1"); saslauthentication.unblacklistsaslmechanism("digest-md5"); abstractxmppconnection con = new xmpptcpconnection(config); try { con.connect(); con.login(); } catch (exception ex) { system.out.println(ex.getcause() + " " + ex.getmessage()); logger.getlogger(redcore.class.getname()).log(level.severe, null, ex); }
Comments
Post a Comment