[英]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. 我有我朋友的Facebook ID,现在想通过基于Flex的应用程序向他发送消息。 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. 更新:我登录到我的facebook个人资料,并希望通过使用基于flex的应用程序将消息发送给所有朋友。
Note: I have fetched facebook profile id of all friends. 注意:我已获取所有朋友的Facebook个人资料ID。
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/ . Facebook最近发布了Notifications API ,另请参阅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). 进行FQL查询以使用Facebook ID(123)查找用户的username
。
SELECT username FROM user WHERE uid = 123
FQL user: http://developers.facebook.com/docs/reference/fql/user/ FQL用户: 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. 获取username
后,您可以将电子邮件发送至username@facebook.com
,收件人将以Facebook消息的形式接收该电子邮件。
Example: Allowing users of facebook application to communicate somehow 示例: 允许Facebook应用程序的用户以某种方式进行通信
(The example is using PHP but the idea is the same) (该示例使用PHP,但思路相同)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.