Posting image to Facebook album with AS3 API

风流意气都作罢 提交于 2019-12-01 07:37:00

I'm guessing you need the access_token in your params :) When posting something on a user's facebook, you always need this one (not always necessary when getting information). The way to get the accesstoken is shown below :)

public function post():void
{
    var _params:Object = new Object();

    _params.access_token = Facebook.getSession().accessToken;
    _params.message = "";
    _params.image = myImageBitmap;
    _params.fileName = "";

    Facebook.api("me/photos", imagePostCallback, _params, URLRequestMethod.POST);
}

also make sure that you have the right permissions when asking for permissions with your app.

EDIT

Ok, so I've missed your edit a bit there ;) it should be possible to create your own album. Take a look at this php-code for graph api. The code should also be able to be parsed to AS3.

http://developers.facebook.com/blog/post/498/

EDIT2

ok, i've done some more digging (seemed interesting to know). This should actually work when using graph api.

FB.api('/me/albums', albumCreateCallback, {name: 'name of the album', message: 'description of the album'}, URLRequestMethod.POST);

When you then call for another api call to upload your image in the albumCreateCallback, it should work and upload your image (according to what i've found).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!