使用as3上传facebook图片

时间:2014-03-12 09:04:35

标签: javascript actionscript-3 facebook-graph-api facebook-javascript-sdk facebook-as3-api

我们将图片上传到脸书时收到此错误。我获得了权限。

https://graph.facebook.com/me/photos

{
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500
   }
}

这是我的as3

var params:Object = {image:img, message:'vcxv', fileName:'vcxvc',name: 'My Card'};
Facebook.api('/me/photos', onSaveToPhotoAlbumComplete, params, "POST");

请帮帮我。

1 个答案:

答案 0 :(得分:1)

您必须向对象添加访问令牌:

access_token:Facebook.getAuthResponse().accessToken

var params:Object = {image:img, message:'vcxv', fileName:'vcxvc',name: 'My Card', access_token:Facebook.getAuthResponse().accessToken};
Facebook.api('/me/photos', onSaveToPhotoAlbumComplete, params, "POST");