使用Prime31,我可以成功地将图像上传到我自己的墙上呼叫
public void postPhoto(byte[] photoBytes){
Facebook.instance.postImage( photoBytes, "my message", completionHandlerUploadPhoto );
}但现在我想把同样的照片发布到Facebook的相册页面上。我试着调用我写的这个函数:
public void postToFatFishPage(byte[] photoBytes){
Dictionary<string, object> arguments = new Dictionary<string, object>();
arguments.Add("access_token", FacebookAndroid.getAccessToken());
arguments.Add("message", "my message");
arguments.Add("image", photoBytes);
Facebook.instance.graphRequest("/"+facebookPageID+"/photos", HTTPVerb.POST, arguments, ( string error, object obj ) =>
{
Debug.Log ("In Callback postToFatFishPage");
// if we have an error we dont proceed any further
if( error != null ){
Debug.Log("Error posting Photo to FatFish FB-Page: " + error);
return;
}
Debug.Log("No error");
});
}回调函数说没有错误,但我发布到的Facebook页面显示没有上传图片,这是一个错误。
我使用以下权限登录:
FacebookAndroid.loginWithPublishPermissions( new string[] { "email", "user_birthday" } );也许我必须添加更多的权限?
希望有人能帮助我!
编辑
我也试着用album_id代替page_id,但两种方法都不起作用。仍然没有错误...我打印出了回调的字典:
{
[id] = <some long number>,
[post_id] = <some even longer number with a underline in center>,
}发布于 2013-11-11 20:52:28
我不知道我到底做了什么,但我知道它正在神奇地工作。(星期一...)
这就是函数:
public void postToFatFishPage(byte[] photoBytes){
Dictionary<string, object> arguments = new Dictionary<string, object>();
arguments.Add("access_token", FacebookAndroid.getAccessToken());
arguments.Add("message, myMessage);
arguments.Add("image", photoBytes);
Facebook.instance.graphRequest("/"+pageID+"/photos/", HTTPVerb.POST, arguments, ( string error, object obj ) =>
{
// if we have an error we dont proceed any further
if( error != null ){
Debug.Log("Error posting Photo to FatFish FB-Page: " + error);
return;
}
Debug.Log("SUCCESS!");
});
}我希望有我可以帮助的人:)
https://stackoverflow.com/questions/19861622
复制相似问题