Graph API Facebook : user id - facebook

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.

Related

Facebook Bot: Message Mentioner

I'm trying to build a bot that would message anyone who mentions (#PageName) it. I have set up the mention webhook for my bot so that whenever anyone mentions my page in a comment or post, I receive a notification. Unfortunately, Facebook doesn't make it easy to message the person who mentioned my page, since there are different page IDs and messenger IDs. I am able to fetch the user ID from the mention by fetching the from field from the graph API, but is it possible to convert this user ID to a messenger ID so that I may actually message the user?

Appcelerator Titanium facebook send specific content

I am trying to send some specific content from my Application to the user's status wall.
Lets assume that the user already logged in to facebook through my app - And lets say that my app displays a lot of jokes and riddles. A user finds a joke and he/she wants to publish the joke to his/hers facebook profile (Or even send it through SMS too? (Just a side question, not important))!
How is this possible?
Thanks!
Construct a JSON object with the appropriate Graph API fields corresponding to your joke, and send it to the Graph API using an XHR requestWithGraphPath. For text messages, you might take a look at Twilio.

How can i send app request to both FB friends and application users?

I've a situation in my application where I need to send apprequests (or any way of sending any request to my users) for both my facebook friends as well as the same application users.
The problem with this is ,
when we are sending apprequests using application itself(using app_access_token) we can't send app requests to my facebook friends who are not yet part of my application ("oAuthException : User must accept TOS" will be thrown).
So when i use the 'Request dialog' (FB.UI app request method) its possible to list/send requests to only FB friends .
So i need a solution for having a method where i can list all my user's FB friends and application users and send apprequest at once to all..
Anybody has tried something like this before?
And also i tried FB.UI (send method) and searched for graph API and also considered option of posting wall message and everything doesn't work both types..
Any help on this?
May I draw your attention to the following Facebook Documentation for AppRequests:
http://developers.facebook.com/docs/reference/dialogs/requests/
You need to have a look at the section headered "Frictionless requests".
From what I understand from this sentence:
Upon first sending a request to a friend from within an app, a user may authorize the app to send subsequent requests to the same friend without prompting for his permission.
It sounds like there is no way to "bulk" send to all of a user's friends, it is on a friend-by-friend basis. It sounds sensible to me, I wouldn't want my all of my Facebook friends to be flooded with invitations either.
You could however opt for prompting the user with the Friend Request interface which is much friendlier to your users... this is available using the Javascript SDK.

How to use Facebook Application to write a notification to Users

i'm developing an application for a university exam, using Appengine and Gwt (Google products) and i'd like to implement Facebook this way:
- give the ability to a FB user to login to the application through facebook (did this implementing the oAuth2.0 flow, so now i have the user's access token and his permissions)
- since the application is for being notified when a professor publishes some material for his course (this is all handled by appengine), i'd like to notify the user when a professor publishes some material, through a wall post or a note from my application in a way that it writes to the user something about the new published material.
I've been looking through EVERY single resource online, and couldn't find an answer: a lot of similar questions but no answers.
Writing the POST is not a problem, and for the moment i'm trying with the api graph explorer.
I manage to write on the user's wall/note as if he's writing himself or (if the user likes the application) write all the likers a wall post/note (but the same to everyone).
But i don't find a way to send personalized wall posts/notes to every user in response to some specific material published.
FB doesn't allow to do this because is considered spamming?
You can't directly post things to your user's wall as a way of notifying them - wall posts are intended to be things the user posts from within your app (for instance, they find something in your app interesting and choose to share it with their friends, so they click a 'Share' button).
You could try using an App-Generated Request (http://developers.facebook.com/docs/channels/#requests). This will increment the user's Bookmark Counter, and when they click on it they will enter your app and you can show them the latest news.
OR, you could ask for the 'email' permission for your app, and send the user an email notification when something is new.

Facebook: Best way to allow one Facebook user to send a secure link to another Facebook user?

Hey, I'm a product management guy looking to understand how we can deliver audio clips into Facebook. Specifically, I'd like to allow a user (a "sender") who is logged into my iPhone app through Facebook connect to send a link for an audio file to another Facebook user (a "recipient" who has never logged into my app). I understand that it's not currently possible for this link to be sent as an outside email to the recipient, or even as an internal Facebook message. Is that still true?
If so, I'm wondering if it's possible (and advisable?) to post it as a chat message, or as an invite that is posted to the recipient's wall. For the chat message, if it's possible then what are the downsides of that method? For the invite, I realize the wall post will only be visible to the recipient, but I'm concerned that the recipient may not realize that and will think that the audio file is available to anyone who views his profile.
As such, for the invite method, I'd like to require the recipient (after they click a link in the wall post invite) to login to our web site where the audio is hosted via Facebook connect before listening to the audio. Is it possible to accomplish that? In other words, will I be able to know when the person logs in through Facebook connect that he is the recipient? In addition to a token in the audio link URL, how do I track that? Will I need to track a user ID or something?
Thanks in advance for your thoughts!
I'd go with the wallpost method.
I'd implement it by letting the initial user share a link on a friend's wall saying "User has shared a song with you! Click here to open it!" or something like that. When any user clicks that link, prompt for install and once they're authenticated, show them any files that are theirs (and yes, you'll need to check their user ID vs. the user IDs that were stored as links in your database).
If it's not the friend who clicks the link, they won't see anything (or they'll see something different). You could even use a customized link and show an error if an unauthorized user clicks to that page.
For what it's worth, this is how Amazon handles giving Amazon gift cards via Facebook.
If this is unclear or too vague, let me know and I'll clarify.