FB 对话框接口

官方文档: https://developers.facebook.com/docs/dialogs

FB的对话框主要是调用 FB.ui(); 方法。

有问题上官网看文档是最好的。

1. send Dialog  (发送message)

JS 调用

FB.ui({
  method: 'send',
  link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html',
 to: '123456', });

URL 调用 (这个还不确定用法)

http://www.facebook.com/dialog/send?
  app_id=APPID
  &link=http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html
  &redirect_uri=APPURL

参数说明

app_id : 

redirect_uri : 跳转链接 (不确定用法)

display : 显示方式 (不确定用法)

to : 接收消息的人 

link : 消息带的链接

2. Feed and Share Dialogs

JS 调用

var obj = {
    method: 'feed',  // 
    name: name,    // link名字
    caption: ' ',  // 标题
    description: desc,  // 描述
    link: href,    // feed 链接
    picture: feed_img_path+msrc,  // feed图片
    display:'iframe',   // 显示方式
    actions:{        // feed动作
        name: action,     // 动作名字
        link: href     // 动作链接
    }
};

FB.ui(obj, function(d){}); // 主动发送
FB.api('/me/feed', 'post', obj, function(d){}); // 自动发送

其余参数:

from: 从某人接收过来

to : 发送给某人

properties: 一些属性,出现在description后面,一对key/value 对应一行

 3. Friends Dialog

FB.ui({
  method: 'friends',
  id: 'brent'
}, function(response){});
原文地址:https://www.cnblogs.com/zjfazc/p/3517840.html