给朋友发送私信 [英] Send private messages to friends

查看:22
本文介绍了给朋友发送私信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过 Facebook 连接用户的信息,并向他的所有朋友发送私人消息.可能吗?

I need to get via Facebook connect user's info and send a private message to all of his friends. Is it possible?

推荐答案

现在可以通过 api 发送私人消息.

Sending private message through api is now possible.

为发送消息触发此事件(Facebook 对象的初始化应在此之前完成).

Fire this event for sending message(initialization of facebook object should be done before).

to:user 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:'sdf sdf sfddsfdd s d  fsf 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.


向其发送消息的用户 ID 或用户名.一旦对话框出现时,用户可以指定其他用户、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.

图片
默认情况下,将从指定的链接中获取图片.网址包含在消息中的图片.图片将显示在链接旁边.

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.

查看更多此处

@VishwaKumar:

@VishwaKumar:

要发送带有自定义文本的消息,您必须在 FB.ui 中添加message"参数,但我认为此功能已被弃用.您不能再预先填写消息.虽然尝试一次.

For sending message with custom text, you have to add 'message' parameter to FB.ui, but I think this feature is deprecated. You can't pre-fill the message anymore. Though try once.

FB.ui({
  method: 'send',
  to: '1234',
  message: 'A request especially for one person.',
  data: 'tracking information for the user'
});

请参阅此链接:http://fbdevwiki.com/wiki/FB.ui

这篇关于给朋友发送私信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆