How to get the list of friends to whom a user has sent a private msg using the FB send button from my site? - facebook

I have a send button integrated on one of the pages of my site and I allow the users to share a link pointing to some private information with their facebook friends using this send button.
Only these friends who have received the message are supposed to access this link. In order to validate this, I want to capture the list of friends & possibly their FB ids to whom the user of my website sends a private FB message using the send button on my website.
Is there a way to capture this list i.e. the list of private message recipients as selected by the user?
Alternatively, is there a way that I provide a multi friend selector from where the user of my website selects the fb friends to whom they want to send a fb message and then using a FB send message api, I send this message - thus achieving the purpose as desired above?

The Send button does not allow you to see which Facebook Users the message was sent to.
You should instead use the Direct Requests Dialog instead:
http://developers.facebook.com/docs/reference/dialogs/requests/#direct_request
You can create your own multi-friend-selector and then use the above dialog to send the requests to friends. You can authenticate the request when the friend clicks on the Accept button. The function returns request and to, which contain the request_id and a array of user_ids, respectively.

Related

Prefill Facebook messenger message or send out to the group

for one client we are trying to prepare solution, that after click on button will send from the users facebook messenger message to the facebook group with details like URL of the product etc.
Generally, I come to the product detail as a user, click on the Contact us button and, it will
Prefill the message with the URL to the product and some message
AND / OR
Send the message to the Facebook group that is responsible for the website the user is sending it from.
Is there any way to do this? I know how to do the opposite way of messaging, from the company to the user, but is it possible to do it this way?

Graph API Facebook : user id

I am working on a business application which is using facebook and I need to send a private message to a connected user friend.
For getting all the user friends, I am using me/taggable_friends. In this way I have all the user friends but I can't retrieve the real friend user id. I need to know this field for sending a private message (or request or notification).
Regarding the FB documentation, this feature is only available for the "games" product but it's look like strange.
Maybe i'm doing something wrong but I don't understand how should I proceed.
Thank's for your answers.
taggable_friends can (and should) only be used for tagging friends, you donĀ“t even get an ID with it, only a tagging token (see Facebook docs).
For sending private messages, the best (and only) way is to use the Send Dialog of the JavaScript SDK: https://developers.facebook.com/docs/sharing/reference/send-dialog
The user has to input the target friend and the message on his own, which is a requirement for the message anyway. It always has to be 100% user generated.
The Chat API is deprecated and should not be used anymore: https://developers.facebook.com/docs/chat
On iOS, if you want to send a private message to another Facebook user, you should use the Message Dialog: https://developers.facebook.com/docs/ios/share#message-dialog
This lets a user share a message with any of their FB friends, then return to your app. You can ensure the message contains a link which the recipients will be able to click on.

facebook send dialog prepopulated with text

I am developing an application where I want to be able to send messages to friends.
I want to display a list of friends and besides each friend there is a button which triggers the send dialog.
But I want the dialog to be prepopulated with the friends's name and a text like: I want to invite you to this event..
How can I do this?
PS: I am not intending to send messages to multiple users at one time, as this is not possible. For each message sent there will be necessary the user hiting the send button
This is not possible, the Send button is designed for sharing URLs and doesn't allow the page owner to set the message which will be shared along with the content, or the intended recipients - it runs in an iframe so the browser security model will prevent you trying to do this manually.
If you want to have users send customised messages, check out the Feed dialog: http://developers.facebook.com/docs/reference/dialogs/feed/

FB.ui request dialogs: preselecting some friends

FB.ui Request dialogs: (With method: 'apprequests') allow you to send a request from your app.
http://developers.facebook.com/docs/reference/dialogs/requests/
This says, you can specify one friend in the two value. However I want to specify N friends which are preselected, but can be edited. Is it possible in this widget. If not, What alternate widgets can I use
This isn't possible via that Facebook javascript sdk, most likely to be less spammy and not default to sending to every single person a user is friends with. The way to get around this would be to build your own dialog using the graph api. You would retrieve all the users that a person is friends with, present them with your own dialog to let them choose users, and then send graph api requests over for each request.
Update:
Per Facebook's blog post, you can only send invitations to users through their Requests dialog. And this dialog will not let you pre-populate all users as checked. Graph api can only send to other users that have authenticated with the app.

How does RockMelt send Facebook messages?

Everything I've read says that you can't send messages but in RockMelt you can send your friend a beta invite through Facebook messages.
Are they using a preview of the Inbox API? Is there another way they're doing this?
This was taken from an answer on Quora that Eric Vishria the CEO of Rockmelt said:
"If a user wants to invite a friend who has not signed up on our site, we generate a download link, and pre-populate a Facebook message (in our own UI) that the user can edit/tailor and click Send, or copy and send via some other means (email, chat...).
We do not auto-send Facebook messages and the messages aren't from us, they are user to user.
If a user invites a friend who has signed up on our site (via the "Hook 'em up" button) that sends a notification to our backend that a user has been hooked up and we send that friend an email that such and such user has hooked them up. We are able to do this because when users sign up on our website, they connect via Facebook and authorize our application to send them email.
We spent a lot of time making the system not spammy (no auto posts to feeds, no automatic emails, etc....) where invites go to people who want them or users have to take an explicit action to tell their friends about it."
http://www.quora.com/What-Facebook-permission-enables-an-app-to-send-user-to-user-messages?redirected_qid=97754
To send a message to a friend you can use the Send Dialog, similar to the Feed dialog that will post to the wall but it lets the user select one or more friends and send a message:
https://developers.facebook.com/docs/reference/dialogs/send/