给朋友发消息,我想知道Javascript API

Send a message to a friend, I wonder Javascript API

本文关键字:想知道 Javascript API 朋友 消息      更新时间:2023-09-26

我是来自韩国的开发人员。

我目前正在制作基于Facebook和Twitter的网站。

我想使用一个可以向朋友发送消息的JavaScript API,

所以我咨询了iframe Javascript API方法或使用Facebook页面看起来像发送。

我想知道,

我用来向朋友发送消息作为Javascript API提供?

我不太懂英语。所以我用了谷歌翻译。

请理解。

(Edited, fixed some grammar and rewording)

FB.api (path, "post", {
        message: msg,
        caption: "caption caption",
        link: "http://www.naver.com",
        description: "Description Description",
        picture: "http://sstatic.naver.net/search/img3/h1_naver.gif",
        tag: "Tag",
        name: "name names",
        access_token: accessToken
        }, Function (response) {
        if (! response | | response.error){
            alert ("error");
        }
        else{
            alert (response.id);
        }
    })
您想在

Facebook上向朋友发送消息,或发布到Facebook墙上供所有人查看?我将假设在Facebook上向朋友发送消息。

手动

如果您想使用 JS SDK 向 Facebook 上的朋友发送消息,请按照以下说明操作:https://developers.facebook.com/docs/reference/dialogs/send/

这不是自动的,仍会显示一个对话框供用户确认。

自动

如果你想通过图形 API 在后台执行此操作,则不能。这是一个链接,更详细地解释了为什么你不能以及您拥有的其他选项:https://stackoverflow.com/a/4061298/540339