Hey I am a smack beginner! how can i display every response from the xmpp server?
I try to send messages but a lot of them get lost on the way so i want to check the response of the server. I am using smack 3.3.1 sending to the facebook xmpp port.
DeliveryReceiptManager and/or MessageEventManager wont show anything so i would like to see everything the server is responding!
What response can i expect from the facebook xmpp port? Their doc is very poor!
connection.login(apiKey, accessToken);
try{
DeliveryReceiptManager deliveryReceiptManager =DeliveryReceiptManager.getInstanceFor(connection);
deliveryReceiptManager.addReceiptReceivedListener(newReceiptReceivedListener(){
@Override
publicvoid onReceiptReceived(String s,String s2,String s3){
System.out.println("REVEIVED RESPONCE");
System.out.println(s);
System.out.println(s2);
System.out.println(s3);
}
});
Chat chat = connection.getChatManager().createChat("100007499312629@chat.facebook.com",newMessageListener(){
@Override
publicvoid processMessage(Chat chat,Message message){
if(message.getType()==Message.Type.chat)
System.out.println(chat.getParticipant()+" says: "+ message.getBody());
}
});
Message msg =newMessage();
msg.setSubject("Invite");
msg.setBody("blablabla", \"1234567890@chat.facebook.com");
DeliveryReceiptManager.addDeliveryReceiptRequest(msg);
//MessageEventManager.addNotificationsRequests(msg, true, true, true, true);
chat.sendMessage(msg);
try{
Thread.sleep(10000);
}catch(InterruptedException e){
e.printStackTrace();
}
}catch(XMPPException e){
e.printStackTrace();
}