7

FB authentication is proper and i can receive messages. Only issue is when sending messages to a FB friend. No error messages or warnings are being shown, but the message is simply not delivered to the FB friend.

This is the string that i am sending

<message xmlns="http://www.facebook.com/xmpp/messages" to="-FB_ID@chat.facebook.com">
<body>my_message</body></message>

Any one having same issue?.

Deepukjayan
  • 3,525
  • 1
  • 20
  • 31
  • No, its nothing, my mistake, I got a bit confused between notification and chat api. Are you using all the parameters in your request?? – Jhanvi Oct 30 '13 at 06:57
  • Yeah, cause It used to work perfect and I haven't made even a small change in that. Suddenly now it isn't working. There is no issue with updating presence and receiving messages. Issue only exists in sending.. – Deepukjayan Oct 30 '13 at 07:04
  • Try this [previous questions][1] maybe can help you. [1]: http://stackoverflow.com/questions/15813542/facebook-xmpp-chat-api-send-message-php?rq=1 – Joko Wandiro Nov 01 '13 at 03:11

3 Answers3

1

The "from" parameter is missing in your requset. Message format should be like this:

 <message from="-sender_ID@chat.facebook.com" to="-receiver_ID@chat.facebook.com">
 <body>your_message</body>
 </message>
Jhanvi
  • 5,069
  • 8
  • 32
  • 41
  • I did add that. That is not the issue. It used to be okay without it also. Now even with the from param isn't working. – Deepukjayan Oct 30 '13 at 07:06
  • @Deepukjayan did you try with different friend ids, i mean your code seems to be correct maybe it is not working with a particular id, due to some fb exception itself?? – Jhanvi Oct 30 '13 at 07:10
1

Is this something to do with the 5000 friend limit ? I mean, you are not allowed to have more than 5000 friends on FB, therefore, I'm guessing there is a security issue that stops you posting once you hit that limit ?

1

Issue fixed.

Author replied me:

OK, I haven't done anything with Facebook chat but why are you setting the xmlns?

That exactly was my problem. I was sending the xmpp messages as shown below:

<message xmlns="http://www.facebook.com/xmpp/messages" to="-FB_ID@chat.facebook.com">
<body>dd</body></message>

When I removed the xmlns attribute, everything is fixed :)

Deepukjayan
  • 3,525
  • 1
  • 20
  • 31