send message to selected friends in facebook

瘦欲@ 提交于 2020-01-05 07:57:15

问题


I have the following code to send messages to selected friends by custom made

$friends = $facebook->api(array(
            "method"    => "fql.query",
            "query"     => "SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"
        ));

where $facebook is the one having the details of the application & key values.,

& I get my friends list into the $friends

I'll be having a textarea too to enter the message that has to be sent,

now I'll be passing the selected list of friends & message to a function as follows

function facebook_send_message(to,message) {
        FB.ui({
            app_id:'MY APP ID',
            method: 'send',
            name: 'Abcdef',
            link: 'http://apps.facebook.com/',
            to:to,
            message:message

        },function(response){alert(response);});
    }

when this function was called, a facebook popup opens, but my form in which all these content is placed gets submitted, I'm not able to send the message to the selected friends, do anyone can help me in this issue..


回答1:


For sending message with custom text, you have added 'message' parameter to FB.ui, but this feature is Deprecated. You can't pre-fill the message anymore.

This was deprecated might be because of bad advertisements. So don't use 'message' parameter for message.



来源:https://stackoverflow.com/questions/16465119/send-message-to-selected-friends-in-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!