通过Facebook API发送私人消息

问题描述:


可能重复:

Facebook Api - 向朋友发送私人讯息

我知道通过FB API发送私人消息是不正式的。 SO中的每一个线索也是如此。但是我使用的是RockMelt浏览器,当您邀请某人时,会向他们发送一条私人消息。意味着可以通过API发送私人消息。更重要的是,Facebook是可以的。

I know that it is not officially possible to send private messages through FB API. Every thread in SO says so too. But I was using RockMelt browser and when you invite somebody, a private message is sent to them. Means it is possible to send private messages through API. More importantly, Facebook is okay with it.

任何猜测他们如何使用它?这是使用套接字的一些HTTP POST技巧吗? BTW,我们将仅对用户启动的操作使用此功能。

Any guesses on how they are using it? Is it some HTTP POST trick using sockets? BTW, we are going to use this feature only on user initiated actions.

现在可以。
消除此方法发送消息(Facebook对象的初始化应该在之前完成)

This is now possible. Fire this method for sending message(initialization of facebook object should be done before).

to:Facebook的用户ID

to:user id of facebook

function facebook_send_message(to) {
    FB.ui({
        app_id:'xxxxxxxx',
        method: 'send',
        name: "sdfds jj jjjsdj j j ",
        link: 'https://apps.facebook.com/xxxxxxxaxsa',
        to:to,
        description:'sasa d d dssd ds sd s s s '

    });
}

属性


  • app_id

    您的应用程序的标识符。大部分SDK都自动指定

  • app_id
    Your application's identifier. Required, but automatically specified by most SDKs.

redirect_uri

用户点击发送后重定向到的URL或取消
按钮。大部分
SDK都必须自动指定。

redirect_uri
The URL to redirect to after the user clicks the Send or Cancel buttons on the dialog. Required, but automatically specified by most SDKs.

显示

呈现对话框的显示模式。这是大多数SDK指定的

display
The display mode in which to render the dialog. This is automatically specified by most SDKs.



发送邮件的用户标识或用户名。一旦对话框
出现,用户可以指定发送消息的其他用户,Facebook组和
电子邮件地址。将内容发送到
Facebook群组将发布到群组的墙上。

to
A user ID or username to which to send the message. Once the dialog comes up, the user can specify additional users, Facebook groups, and email addresses to which to send the message. Sending content to a Facebook group will post it to the group's wall.

链接

(必填)邮件中发送的链接。

link
(required) The link to send in the message.

图片

默认情况下,将从指定的链接中获取照片。要包含在消息中的图片的URL
。该图片将在链接旁显示

picture
By default a picture will be taken from the link specified. The URL of a picture to include in the message. The picture will be shown next to the link.

名称
默认情况下,将从指定的链接中获取标题。
的名称链接,即显示用户将点击的文本。

name By default a title will be taken from the link specified. The name of the link, i.e. the text to display that the user will click on.

描述

默认情况下将从指定的链接中进行描述。
描述性文字显示在链接下方。

description
By default a description will be taken from the link specified. Descriptive text to show below the link.