Can't send message to FB

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?.


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>

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 ?


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 :)

链接地址: http://www.djcxy.com/p/16698.html

上一篇: s3上的文件权限

下一篇: 无法发送消息给FB