XMPP ASMACK 电子卡
我无法获取 vcard 信息。
我已经尝试了这两种方法,
VCard card = new VCard();
card.load(connection);
Log.i("VCARD", card.getFirstName());
在此期间我遇到了超时错误......
另外在建立连接之前也尝试过这个......。
configure(ProviderManager.getInstance());
public void configure(ProviderManager pm) {
pm.addIQProvider("vCard", "vcard-temp", new VCardProvider());
}
final IQ iq = new IQ() {
public String getChildElementXML() {
return "<iq from='[email protected]' id='v1'
type='get'><vCard xmlns='vcard-temp'/>
</iq>";
}
};
iq.setType(IQ.Type.GET);
connection.sendPacket(iq);
connection.addPacketListener(new MyPacketListener(),new PacketTypeFilter(IQ.class));
请指导我如何获取 VCARD 信息。
I am not able to get the vcard information.
i have tried both methods,
VCard card = new VCard();
card.load(connection);
Log.i("VCARD", card.getFirstName());
During this i got that timeout error.....
Plus also have tried this.... before making a connection.
configure(ProviderManager.getInstance());
public void configure(ProviderManager pm) {
pm.addIQProvider("vCard", "vcard-temp", new VCardProvider());
}
final IQ iq = new IQ() {
public String getChildElementXML() {
return "<iq from='[email protected]' id='v1'
type='get'><vCard xmlns='vcard-temp'/>
</iq>";
}
};
iq.setType(IQ.Type.GET);
connection.sendPacket(iq);
connection.addPacketListener(new MyPacketListener(),new PacketTypeFilter(IQ.class));
Please guide me how to get VCARD Information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于这些请求中的任何一个,您都需要设置一个
to
地址。现在,这些将发送到您的服务器,该服务器可能未实现 XEP-0054 。On either of those requests, you'll need to set a
to
address. Right now, these are going to your server, which likely doesn't implement XEP-0054.