提示(或不提示)用户将故事发布到 Javascript 中的个人资料提要

发布于 2024-12-04 03:56:16 字数 1322 浏览 0 评论 0 原文

我正在做一个在页面内作为选项卡(iframe)加载的应用程序
我正在使用 PHP 和 JS SDK,最新的 在用户授权stream_publish等权限后,我已经能够使用PHP发布到用户的墙

现在我的问题是当他点击我的选项卡中显示的按钮之一时发布到用户的墙。
我正在尝试这段代码:

function post_wall()
{
    FB.ui(
    {
        method: 'feed',
        name: 'Publish example of www.compilaron.com',
        link: 'http://example.com/myapp/files/506625449_thumb.jpg',
        picture: 'http://example.com/myapp/files/506625449_thumb.jpg',
        caption: 'Example caption',
        description: 'Example description to test the post',
        message: 'Facebook Dialogs are not easy!',
        redirect_uri: 'http://www.facebook.com/myFanPage?sk=app_ID'
    },
    function(response) {
        if (response && response.post_id) 
        {
            alert('Post was published in Wall.' );//+ response.toSource());
        } 
        else 
        {
            alert('Post was not published in Wall.' );//+ response.toSource());
        }
    });
}

首先,我收到 api 错误 191。然后添加了redirect_uri 参数,现在收到 api 错误 100。似乎我使用的代码很旧,但找不到一些可以发布到用户墙的代码无需离开粉丝页面,重定向并返回内容(如以下网址所述)

https://developers.facebook.com/docs/reference/dialogs/feed/

另外,如果您有 JS 代码可以直接发布到用户的 feed,没有问题,用户已授予权限。 ..

有什么想法吗?
谢谢

I'm doing an app which loads as tab (iframe) inside a Page
I'm using both, PHP and JS SDK, latest
I've been able to post to user's wall with PHP, after user authorized stream_publish, etc. permissions

Now my problem is to post to user's wall when he clics one of the buttons showed in my tab.
I'm trying this code:

function post_wall()
{
    FB.ui(
    {
        method: 'feed',
        name: 'Publish example of www.compilaron.com',
        link: 'http://example.com/myapp/files/506625449_thumb.jpg',
        picture: 'http://example.com/myapp/files/506625449_thumb.jpg',
        caption: 'Example caption',
        description: 'Example description to test the post',
        message: 'Facebook Dialogs are not easy!',
        redirect_uri: 'http://www.facebook.com/myFanPage?sk=app_ID'
    },
    function(response) {
        if (response && response.post_id) 
        {
            alert('Post was published in Wall.' );//+ response.toSource());
        } 
        else 
        {
            alert('Post was not published in Wall.' );//+ response.toSource());
        }
    });
}

First, I got api error 191. Then added redirect_uri parameter and now getting api error 100. Seems like the code I'm using is old, but can't find some code that can publish to user's wall without leaving the fanpage, redirecting and going back stuff (as stated in the following url)

https://developers.facebook.com/docs/reference/dialogs/feed/

Also, If you have a JS code to post directly to user's feed, no probs, user granted permissions...

Any ideas?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心凉怎暖 2024-12-11 03:56:16

我想我找到了解决问题的方法。

一个完整的 facebook iframe 应用程序,包含用 php 和 js 编写的发布共享对话框、状态更新、ajax 等示例...

http://thinkdiff.net/facebook/iadvance-graph-api-iframe-base-facebook-page-app-development/

I guess I found a solution to my problems.

A complete facebook iframe application with examples of posting share dialog, status update, with ajax, etc. in php and js...

http://thinkdiff.net/facebook/iadvance-graph-api-iframe-base-facebook-page-app-development/

清眉祭 2024-12-11 03:56:16

为了使redirect_uri正常工作并且不会出现错误191,redirect_uri需要由应用程序拥有。

In order for the redirect_uri to work properly and not get error 191, redirect_uri needs to owned by the application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文