1

我正在尝试以编程方式更改 facebook 页面选项卡图像。这个想法是当我的应用程序完成安装过程时,它将更改放置它的选项卡的图像。完成该过程并授予应用程序权限后,fb 的响应为“未授权”

{"error":{"message":"(#300) Edit failure","type":"OAuthException","code":300}}

我搜索了这个错误,最接近的方法是:https ://developers.facebook.com/bugs/255313014574414/ 。我尝试了错误中描述的相同 CURL 示例并得到了相同的响应。

奇怪的是,当我尝试更改 fb 中的图像时,它也失败了。我认为问题在于应用程序要求在用户页面中安装的权限,并且没有足够的权限。

但我不知道热我chage 授权chage 的pagetab 图像的许可证。

4

1 回答 1

0
var fbparams = new Dictionary<string, object>();
          string path = @"c:\test.jpg";
          FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
      var picture = new FacebookMediaObject
                {
                        //Tell facebook that we are sending image
                    ContentType = "image/jpeg",
                    //Give name to the image
                    FileName = "test"
                };
                //Create a new byteArray with right length
                var img = tabImageInfo.Media;
                //Convert the image content into bytearray
               fs.Read(img, 0, img.Length);`enter code here`
                 //Close the stream
               fs.Close();
                //Put the bytearray into Picture
                picture.SetValue(img);
                //Add the image into parameters
                fbparams.Add("custom_image", picture);
        fb.Post(tab.id, fbparams);
于 2013-11-13T00:39:22.030 回答