Facebook XMPP Chat API send Message PHP

前端 未结 2 1406
小蘑菇
小蘑菇 2021-01-05 04:07

I am currently messing about with the Facebook Chat API. I want to send chat messages to my facebook contacts via an App.

Using the example provided by facebook I wa

相关标签:
2条回答
  • 2021-01-05 04:34

    You should send to socket command with your message. Common message format is

    <message from="-sender_ID@chat.facebook.com" to="-receiver_ID@chat.facebook.com">
        <body>message body</body>
    </message>
    

    So before comment "we made it!" insert function call send_xml with your message template

    send_xml($fp, $MESSAGE);
    if (!find_xmpp($fp, 'BODY')) {
        return false;
    }
    
    0 讨论(0)
  • 2021-01-05 04:35

    It's the standard xmpp/jabber message format: See 4.2 on http://xmpp.org/rfcs/rfc3921.html#stanzas-message

    0 讨论(0)
提交回复
热议问题