“The post's links must direct to the application's connect or canvas url”?

点点圈 提交于 2019-12-05 04:31:09

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/5395428/the-posts-links-must-direct-to-the-applications-connect-or-canvas-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!