简体   繁体   中英

How to send Facebook message to friend using Facebook ID?

I have my friend's Facebook id and now want to send him a message through my flex based application. How to do it?

Update: I logged-in to my facebook profile and want to send message to my all friends by using flex based application.

Note: I have fetched facebook profile id of all friends.

Facebook recently published the Notifications API , see also https://developers.facebook.com/blog/post/2012/08/31/reach-users-1-1-with-the-notifications-api/ . Those can be send to any user, that is using your app already.

Otherwise, a user-to-user request (considered an “invite”, if the recipient is not user of your app yet) would be the alternative.

Do a FQL query to find the user's username using the Facebook ID (123).

SELECT username FROM user WHERE uid = 123

FQL user: http://developers.facebook.com/docs/reference/fql/user/

Once you have obtained the username of the user, you can send an email to username@facebook.com and the recipient will receive it as a Facebook message.

Example: Allowing users of facebook application to communicate somehow

(The example is using PHP but the idea is the same)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM