Posting image to Facebook album with AS3 API

前端 未结 1 1048
被撕碎了的回忆
被撕碎了的回忆 2021-01-14 01:35

I\'m having trouble with posting an image from my canvas application to the user\'s albums. According to the Facebook docs:

In order to publish a pho

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 02:12

    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).

    0 讨论(0)
提交回复
热议问题