java.lang.IllegalArgumentException: 提供的用户 ID 不是完整的 JID (Smack)
java.lang.IllegalArgumentException: The provided user id was not a full JID (Smack)
我在应用程序中使用 Smack
和 xmpp
发送消息,当我尝试从 phone 发送图片时,我得到:java.lang.IllegalArgumentException: The provided user id was not a full JID
在行中:
OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(id);
为了获取 id,我正在使用此代码:
String id= roster.getPresence("test2@irynas-macbook-air.local").getStanzaId();
怎么了?如何获得full JID
?
我发现是什么问题了,id应该是"test@irynas-macbook-air.local/Irynas-MacBook-Air"
的格式,其中Irynas-MacBook-Air
是resource
,所以“/”后面的部分很重要。
我在应用程序中使用 Smack
和 xmpp
发送消息,当我尝试从 phone 发送图片时,我得到:java.lang.IllegalArgumentException: The provided user id was not a full JID
在行中:
OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(id);
为了获取 id,我正在使用此代码:
String id= roster.getPresence("test2@irynas-macbook-air.local").getStanzaId();
怎么了?如何获得full JID
?
我发现是什么问题了,id应该是"test@irynas-macbook-air.local/Irynas-MacBook-Air"
的格式,其中Irynas-MacBook-Air
是resource
,所以“/”后面的部分很重要。