Search code examples
javaandroidxmppsmack

java.lang.IllegalArgumentException: The provided user id was not a full JID (Smack)


I'm using Smack and xmpp for the sending messages in the app, when I'm trying to send a picture from the phone I get: java.lang.IllegalArgumentException: The provided user id was not a full JID in the line:

OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(id);

For getting id, I'm using this code:

String id= roster.getPresence("[email protected]").getStanzaId();

What's wrong? How to get full JID?


Solution

  • I found out what was the problem, the id should be in the format "[email protected]/Irynas-MacBook-Air", where is Irynas-MacBook-Air is resource, so the part after "/" was important.