Note that there are some explanatory texts on larger screens.

plurals
  1. POXMPP Unable to set up a Listener
    primarykey
    data
    text
    <p>I've successfully connected to XMPP server (from android XMPP client), and I can send messages to a user, but I can't receive responses from that same user.</p> <p>I'm sending messages like this:</p> <pre><code> public void send_message(String message, String buddy) throws XMPPException { buddy += "@localhost"; /* send message to user */ Log.w("Sending mesage " + message + " to user " + buddy, "0"); chat = chatManager.createChat(buddy, messageListener); chat.sendMessage(message); } </code></pre> <p>I'm passing the messageListener to the createChat function. The MessageListener's class is:</p> <pre><code>class XMPPMessageListener implements MessageListener { private String from; private String body; public void processMessage(Chat chat, Message message) { this.from = message.getFrom(); this.body = message.getBody(); Log.w("*****Received message" + body + " from " + from, "0*****"); } } </code></pre> <p>When sending a message to a user I'm getting the following debugging output:</p> <pre><code>W/Sending mesage play to user test@localhost( 823): 0 D/SMACK ( 823): 10:43:54 AM SENT (1156346368): &lt;message id="vwaJX-15" to="test@localhost" from="eleano@localhost/Smack" type="chat"&gt;&lt;body&gt;test&lt;/body&gt;&lt;thread&gt;249ke0&lt;/thread&gt;&lt;/message&gt; D/SMACK ( 823): 10:43:54 AM RCV (1156346368): &lt;presence id="vwaJX-12" to="eleano@localhost/Smack" from="eleano" type="error"&gt;&lt;error code="404" type="cancel"&gt;&lt;remote-server-no D/SMACK ( 823): 10:43:54 AM RCV (1156346368): t-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/&gt;&lt;/error&gt;&lt;/presence&gt; D/SMACK ( 823): 10:43:54 AM RCV (1156346368): &lt;presence id="vwaJX-14" to="eleano@localhost/Smack" from="test" type="error"&gt;&lt;error code="404" type="cancel"&gt;&lt;remote-server-not- D/SMACK ( 823): 10:43:54 AM RCV (1156346368): found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/&gt;&lt;/error&gt;&lt;/presence&gt; </code></pre> <p>And the message "test" is displayed to the connected user test (in this case). I'm sending the message from a user eleano. We can also see there's a debug output "ending mesage play to user test@localhost" being displayed on the screen, indicating that my function is indeed called successfully.</p> <p>Upon receiving the message from test to eleano, I only get this debug output:</p> <pre><code>D/SMACK ( 823): 10:44:00 AM RCV (1156346368): &lt;message id="58Fjj-64" to="eleano@localhost/Smack" from="test@localhost/Spark 2.6.3" type="chat"&gt;&lt;body&gt;yes&lt;/body&gt;&lt;thread&gt;0tlK7o&lt; D/SMACK ( 823): 10:44:00 AM RCV (1156346368): /thread&gt;&lt;x xmlns="jabber:x:event"&gt;&lt;offline/&gt;&lt;composing/&gt;&lt;/x&gt;&lt;/message&gt; </code></pre> <p>But the user eleano is not receiving the message. We can also notice there's no:</p> <pre><code>Log.w("*****Received message" + body + " from " + from, "0*****"); </code></pre> <p>being displayed on the screen, so the MessageListener is never called. Why is that? I've set it up correctly as it says in documentation. </p> <p>Any ideas are welcome. And thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload