0

I need to send to user's friends in facebook some link from my site or predefined message. I got the list friends by this:

FB.api(
                "/me/taggable_friends",
                function (response) {
                    if (response && !response.error) {
                        console.log(response.data);

                    }
                }
            );

which is OK, I'm getting some friends.

At this question Send private messages to friends

author says I need so call method sendof API:

function facebook_send_message(to) {
FB.ui({
    app_id:'xxxxxxxx',
    method: 'send',
    name: "sdfds jj jjjsdj j j ",
    link: 'https://apps.facebook.com/xxxxxxxaxsa',
    to:to,
    description:'sasa d d dssd ds sd s s s '

});

}

It looks simple. Having friends as array of objects:

Object
id: "AaI7nqazWWHMkCjMrKNlvyFHWBRw......HFyppVJqjg4RBZurBg"
name: "Andre ...."
picture: Object

I hoped that I could to create array with id and use array in send-method of api in to:. But trying to start dialog I'm getting error "Bad param". The same if I use the name-property of object. What do I do wrong ?

Community
  • 1
  • 1
Eugene Shmorgun
  • 2,083
  • 12
  • 42
  • 67
  • `taggable_friends` is to be used for tagging only, you are not allowed to abuse it for anything else. You should really let users choose the friends they want to send messages to, instead of trying to pre-determine that via your app. – CBroe Apr 08 '15 at 08:36
  • @CBroe but how I can define the user id , using any request ? Do I have some /me/friends ? – Eugene Shmorgun Apr 08 '15 at 08:47
  • Why would you need to define it? Why not just let the user choose the friends they want to send a message to, the dialog already provides that functionality. – CBroe Apr 08 '15 at 08:49
  • This is requirement of project manager. He wants to exclude this step: select user's for messaging, they have already need to be in dialog. – Eugene Shmorgun Apr 08 '15 at 08:55
  • 1
    Then you are limited to the friends that already are users of your app as well. And btw., the `to` parameter of the Send dialog only accepts _one_ id at a time anyway. – CBroe Apr 08 '15 at 09:04
  • I suspected about protection for antispam or like this. Thx. – Eugene Shmorgun Apr 08 '15 at 09:12

1 Answers1

0

You can't pre-populate the list of recipients, Facebook messages are meant for user-to-user communication and not to invite people to an app or spam friends. It is not a good user-experience as well. The user should always choose the audience themselves.

I'd recommend you read the documentation for the Send dialog which contains all the information you need to make a point when communicating this to the project manager.

Björn Kaiser
  • 9,882
  • 4
  • 37
  • 57