5

I'm trying to create an account from Smack for Android on jabber.at. Here is my code :

XMPPTCPConnectionConfiguration conf= XMPPTCPConnectionConfiguration.builder()
                                .setServiceName("jabber.at")
                                .build();
XMPPTCPConnection connection = new XMPPTCPConnection(conf);

connection.addConnectionListener(xmppConnectionListener);
connection.connect();

AccountManager accountManager = AccountManager.getInstance(connection);
Map<String, String> map = new HashMap<String, String>();
map.put("username", usr);
map.put("password", pwd);
map.put("email", email);
accountManager.createAccount(usr, pwd, map);

I got an error:

W/System.err﹕ org.jivesoftware.smack.packet.XMPPError@2beba168
W/System.err﹕ at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:217)
W/System.err﹕ at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:198)

I have tried with and without the Map, same error. According to Mathias Ertl from jabber.at, it is possible to create accounts remotely, so I'm doing something wrong somewhere. Any idea ?

guik
  • 419
  • 6
  • 11

1 Answers1

1

check if your server support remote account creation.

accountManager.supportsAccountCreation()
  • 3
    it returns org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: bad-request - modify – Jinu Feb 04 '16 at 07:19