小编Kis*_*ath的帖子

如何将自定义字段放入 XMPP vCard Android/SMACK

我目前正在开发一个聊天应用程序,我正在使用以下 Vcard 来存储用户信息。

public void run() {
VCard vcard = new VCard();
vcard.setJabberId(xmppConnection.getUser());
vcard.setNickName(user.getChatId());
vcard.setFirstName(user.getUsername());
vcard.setPhoneHome("CELL", user.getMobileNo()); }
Run Code Online (Sandbox Code Playgroud)

除了上述值,我想向 Vcard 添加新字段,例如

vcard.setNotificationType(user.getNotType())
vcard.setAlerts(user.getAlerts())
Run Code Online (Sandbox Code Playgroud)

这可能吗?如果是这样,请帮助我如何做。谢谢。

android xmpp vcf-vcard smack

5
推荐指数
1
解决办法
1349
查看次数

标签 统计

android ×1

smack ×1

vcf-vcard ×1

xmpp ×1