【发布时间】:2015-01-29 17:40:23
【问题描述】:
我正在尝试在 jabber.at 上从 Smack for Android 创建一个帐户。 这是我的代码:
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);
我遇到了一个错误:
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)
我尝试过使用和不使用地图,同样的错误。 根据 jabber.at 的 Mathias Ertl 的说法,可以远程创建帐户,所以我在某处做错了。有什么想法吗?
【问题讨论】:
-
试试 Smack 4.1.0-beta2-SNAPSHOT。
-
抱歉,答案迟了,但 Smack 4.1.0 和 Openfire 3.10.0 可以解决问题。谢谢。
-
如果你得到答案,你可以写下答案并将其标记为正确,以便其他人得到帮助。就像我需要的:)