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/
Related
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?
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.
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.
Working on my second app and the first using the new Request 2.0 and other recent features.
I've managed to get the app to log a user in and grant the extended permissions.
My app is simple: I want a user to be able to send a message to a friend along with a user-selected graphic to go along with the message. I guess the basic metaphor is a gifting app.
I'm not wrapping my head around the workflow especially as examples using the new Request 2 dialog seem few and far between.
Here's what I'm thinking the beginning of the workflow looks like:
User arrives at app page. Logged in, permissions granted if needed
User selects a graphic (via an html radio button form) to go along with message they enter into an html text form
User selects friend(s) to send the message/graphic to.
I'm assuming I should toss the senderid, receiverid(s), link to graphic (or id), and message into a database.
How do I get the info from my users' selections? Does hitting Send Requests on the FB dialog POST the FB and form POST info to the same page so I can read them via PHP $_POST variables?
When the person receives the request, they accept it, but how do I get them to go through the requests outstanding and display the graphic and message? i.e. Archie logs in and has 6 friends sending him items through my app. How does he, in FB methods, see the message/items that Veronica, Betty and Jughead have sent him?
I don't mean that in a basic way. I know how to do this all if I was just writing a PHP app on my own site. I'd be finished in a few minutes. The part that's causing a head-shaped dent in my desk is trying to work out how it works adding Facebook to the workflow. I've been looking for examples and tutorials but they seem to be out-of-date to the new methods FB wants us to use.
Thanks for any pointers!
When a user follows a request you have access to that request ID. If you need to access additional requests the user needs to "Connect" with your app so you can read that info from the user object. The request ID for the acted upon request will be available to you on your canvas page and it will be up to you to develop a work flow that authenticates the user to be able to access any other requests for that user.
The related blog post that discusses the process is available here:
https://developers.facebook.com/blog/post/464
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/