使用自定义开放图操作时出错

发布于 2024-12-26 12:04:38 字数 1400 浏览 0 评论 0原文

我收到错误

不允许此操作设置用户消息,因为此属性 未请求批准。

对于我已提交审批的自定义开放图谱操作类型 westberksconnect:report

我在 C# .NET 4.0 中使用 Facebook.dll,我使用的代码如下

        string strStatus = "";
        strStatus = HttpContext.Current.Request.QueryString["status"];
        string Lat = HttpContext.Current.Request.QueryString["lat"];
        string Lon = HttpContext.Current.Request.QueryString["long"];

        string strToken = "XXXX";
        string strUpdateText = "We've received a report of a problem with " + strStatus + ".";  

        var client = new FacebookClient(strToken);

        Dictionary<string, object> WallPost = new System.Collections.Generic.Dictionary<string, object>();
        WallPost.Add("message", strUpdateText);
        WallPost.Add("link", "http://maps.google.co.uk/maps?q=" + Lat + "+" + Lon);
        WallPost.Add("name", "View On A Map");
        WallPost.Add("picture", "http://www.westberks.gov.uk/images/common/googlemapicons/service_status/highway_009966.png");
        WallPost.Add("caption", "View a map of the location of the reported problem");
        WallPost.Add("description", "  ");
        WallPost.Add("problem", "http://samples.ogp.me/10150293874562522");

        var response = client.Post("/290203581014564/westberksconnect:report", WallPost);

有谁知道我为什么会收到此错误,他们有解决方案吗?

I'm getting the error

This action is not allowed to set a user message because this property
was not requested for approval.

For a custom Open Graph Action Type westberksconnect:report that I have submitted for approval.

I'm using Facebook.dll in C# .NET 4.0 and the code I'm using is below

        string strStatus = "";
        strStatus = HttpContext.Current.Request.QueryString["status"];
        string Lat = HttpContext.Current.Request.QueryString["lat"];
        string Lon = HttpContext.Current.Request.QueryString["long"];

        string strToken = "XXXX";
        string strUpdateText = "We've received a report of a problem with " + strStatus + ".";  

        var client = new FacebookClient(strToken);

        Dictionary<string, object> WallPost = new System.Collections.Generic.Dictionary<string, object>();
        WallPost.Add("message", strUpdateText);
        WallPost.Add("link", "http://maps.google.co.uk/maps?q=" + Lat + "+" + Lon);
        WallPost.Add("name", "View On A Map");
        WallPost.Add("picture", "http://www.westberks.gov.uk/images/common/googlemapicons/service_status/highway_009966.png");
        WallPost.Add("caption", "View a map of the location of the reported problem");
        WallPost.Add("description", "  ");
        WallPost.Add("problem", "http://samples.ogp.me/10150293874562522");

        var response = client.Post("/290203581014564/westberksconnect:report", WallPost);

Does anyone know why I'm getting this error and do they have a solution to it please?

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

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

发布评论

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

评论(1

还不是爱你 2025-01-02 12:04:38

你的代码对我来说看起来是正确的。您需要提交您的操作以获得批准。
https://developers.facebook.com/docs/opengraph/opengraph-approval/

不幸的是,我等待我的批准已经有一段时间了。

Your code looks correct to me. You neeed to submit your action for approval.
https://developers.facebook.com/docs/opengraph/opengraph-approval/

Unfortunately, i've been waiting for mine to be approved for a while now.

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