send message to selected friends in facebook
Asked Answered
A

1

1

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

Accepter answered 9/5, 2013 at 15:11 Comment(2)
You should specifie only one friend ID after the user can add more names. But as I know and can understand from this documentation:developers.facebook.com/docs/reference/dialogs/send initially you can define only one idClinkstone
And also you can not pre-fill the message parameter for any of the social plugins/dialogs any more. (That parameter just doesn’t get accepted any more.)Gambrell
C
0

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.

Crazyweed answered 13/5, 2013 at 2:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.