“帖子的链接必须指向应用程序的连接或画布 URL”?

发布于 2024-10-26 10:48:56 字数 1392 浏览 2 评论 0原文

我正在使用 Facebook C# SDK 构建 WP7 应用程序。当我尝试向用户墙发布消息(只是一条普通消息)时,一切正常。但是当我尝试将链接发布到用户墙上时,我收到此异常消息:

(OAuthException) (#100) 帖子的链接必须指向应用程序的连接或画布 URL。

有谁知道如何解决这个问题?我听说过画布应用程序,但我认为这不适用于手机应用程序。也许这是 Facebook 上的设置?

如有任何反馈,我们将不胜感激。

这是我用来发布到 facebook 的代码:

private void button1_Click(object sender, RoutedEventArgs e)
    {
        _fbClient.PostCompleted +=
            (o, er) =>
                {
                    if (er.Error == null)
                    {
                        MessageBox.Show("Success");
                    }
                    else
                    {
                        MessageBox.Show(er.Error.Message);
                    }
                };

        var args = new Dictionary<string, object>();
        args["name"] = "Hello World!!"; 
        args["link"] = "http://www.nfl.com"; 
        args["caption"] = ""; 
        args["description"] = ""; 
        args["picture"] = ""; 
        args["message"] = "Hello World from application."; 
        args["actions"] = "";

        FacebookAsyncCallback callback = new FacebookAsyncCallback(this.postResult);
        _fbClient.PostAsync("me/feed", args, callback);
    }

    private void postResult(FacebookAsyncResult asynchResult)
    {
        MessageBox.Show("Success");
    }

注意:如果我从“link”中删除字符串,它就会起作用。

I'm building an application for WP7 using the Facebook C# SDK. When I attempt to post a message to a users wall (Just a plain message) everything works fine. But when I attempt to post a link to the users wall I get this exception message:

(OAuthException) (#100) The post's links must direct to the application's connect or canvas URL.

Does anyone know how to fix this? I have heard of canvas applications but I didn't think this applied to a phone app. Perhaps this is a setting on Facebook?

Any feedback is appreciated.

Here is the code I used to post to facebook:

private void button1_Click(object sender, RoutedEventArgs e)
    {
        _fbClient.PostCompleted +=
            (o, er) =>
                {
                    if (er.Error == null)
                    {
                        MessageBox.Show("Success");
                    }
                    else
                    {
                        MessageBox.Show(er.Error.Message);
                    }
                };

        var args = new Dictionary<string, object>();
        args["name"] = "Hello World!!"; 
        args["link"] = "http://www.nfl.com"; 
        args["caption"] = ""; 
        args["description"] = ""; 
        args["picture"] = ""; 
        args["message"] = "Hello World from application."; 
        args["actions"] = "";

        FacebookAsyncCallback callback = new FacebookAsyncCallback(this.postResult);
        _fbClient.PostAsync("me/feed", args, callback);
    }

    private void postResult(FacebookAsyncResult asynchResult)
    {
        MessageBox.Show("Success");
    }

NOTE: If I remove the string from "link" it works.

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

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

发布评论

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

评论(2

拥抱没勇气 2024-11-02 10:49:00

我在“此处”找到了问题的解决方案。在 Facebook 内的应用程序设置中,您必须将“Stream Post Url Security”设置为 false。希望这对某人有帮助。

I found a solution to my problem "here". In your app settings within Facebook you have to set "Stream Post Url Security" to false. Hope this helps someone.

树深时见影 2024-11-02 10:49:00

前往 Facebook 应用程序。编辑其设置。在“高级设置”页面上,禁用“流发布 URL 安全”选项。

Go to the Facebook App. Edit its settings. On the Advanced settings page, disable the "Stream post URL security" option.

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