开发者

Uploading images through Facebook Graph API

I'm trying to upload a picture through the Graph API, but开发者_如何学编程 somehow it doesn't get through. Correct me if I'm wrong, but if I don't give an album ID, it should create an album by itself right? I'm a quite confused by that.

Right now, I'm using

str = "me/" + item; //item = photos

param = {message: 'Test picture! Hello!', source: '50494276[1].jpg'};

type = post;

Facebook.api(str, handlePost, param, type);

protected function handlePost(result:Object, fail:Object)
{
    if (result)
    {
        textBox_txt.text += "\nPOSTED!"
    }
    else
    {
        textBox_txt.text += "\nSORRY, POSTING FAILED.";
    }
}

However, I keep getting POSTING FAILED. Am I doing it wrong?


make sure your application asked for permissions to upload photos:

var permissions:Array = ['publish_stream','user_photos','user_relationships',];

FacebookDesktop.login(handleLogin, [permissions]);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜