Sending Facebook message as specific page

I've facebook account and a fan page defined within this account. I'm using XMPP to send private messages using the following Java code http://yauritux.wordpress.com/2011/09/24/facebook-chat-with-smack-xmpp-api/

I can easily send and receive messages using my user id and password. However when I try to use my page user ID I'm getting the following error: SASL authentication PLAIN failed: not-authorized (stack below). I tried to use pidgin but I'm getting the same error.

Let me know if you've a solution or direction on how to send a message as a page and not as a user.

Thank you in advance, Moshe

SASL authentication PLAIN failed: not-authorized: at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:337) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203) at org.jivesoftware.smack.Connection.login(Connection.java:348) at com.maiff.was.connectors.impl.fb.FBConsoleChatApp.login(FBConsoleChatApp.java:55) at com.maiff.was.connectors.test.ConnectorTestMain.initFB(ConnectorTestMain.java:55) at com.maiff.was.connectors.test.ConnectorTestMain.main(ConnectorTestMain.java:18)


Pages can only "reply" to user messages, and i am not sure if it even works with XMPP. Keep in mind that the Chat API is deprecated btw: https://developers.facebook.com/docs/chat/

Meaning, after April 2015 it will not work anymore, not even with users.

For Page conversations, there is a specific API endpoint to reply to messages: https://developers.facebook.com/docs/graph-api/reference/v2.2/conversation/messages

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

上一篇: iOS的Robbiehanson xmpp框架没有收到聊天消息

下一篇: 将Facebook消息作为特定页面发送