2013-03-27 73 views
1

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

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

我搜索这个错误,最贴近的形式给出了:https://developers.facebook.com/bugs/255313014574414/。 我尝试了错误中描述的相同CURL示例,并且具有相同的响应。

奇怪的是,当我试图改变fb内的图像时,它也失败了。我认为问题出在应用程序要求在用户页面上安装的权限,并且没有足够的许可证。

但我不知道我热恰克许可证授权恰克的pagetab的形象。

+2

,我也越来越这一点,所以我想这是FB API打嗝。这里是它们的错误跟踪器中的一个未解决的问题:https://developers.facebook.com/bugs/255313014574414/ – 2013-03-29 10:04:45

+0

如果图像不是正确的大小(111px x 74px),我会得到这个错误。 Facebook用于调整图像大小并且不会给出错误。 – thaddeusmt 2013-05-03 00:22:20

回答

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); 
+0

尝试上面的代码。它应该工作,并确保图像是111 * 74 – rakeshvenkata 2013-11-13 00:41:56

+0

http://www.tapanila.net/post-picture-into-a-bookbook/供参考 – rakeshvenkata 2013-11-13 01:20:41