如何从拍击4.1创建一个帐户 [英] How to create an account from Smack 4.1
本文介绍了如何从拍击4.1创建一个帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想对jabber.at创建啪一个帐户为Android。
这里是我的code:
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)
我曾尝试与无地图,同样的错误。
据jabber.at马蒂亚斯·埃特尔,可以远程创建帐户,所以我做得不对的地方。任何想法?
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 ?
推荐答案
检查,如果你的服务器支持远程账号创建。
check if your server support remote account creation.
accountManager.supportsAccountCreation()
这篇关于如何从拍击4.1创建一个帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文