i'm having a bit of trouble with the facebook actionscript graph api
While i can get posting to "/feed" to work with Facebook.ui, (does a facebook popup), i can't seem to get it to work with Facebook.api here is my code:
var values:Object = {
name:"This is my title",
link:"http://example.com",
picture:"http://example.com/icon-75x75.gif",
caption:"this is a caption",
description:"this is a long description",
message:"This is a test message. There are many like it but this one is mine.",
actions:
{
name:"Crazy extra thing",
link:"http开发者_StackOverflow社区://example.com"
}
};
Facebook.api(_user + "/feed", handleSubmitFeed, values, URLRequestMethod.POST);
this is called after Facebook.login() with the permissions "read_stream,publish_stream,user_likes" succeeds and the id is stored in _user. I get the following error:
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://graph.facebook.com/********/feed"]
I'm not having any trouble with other calls to update the user's status ("/statuses") or retrieving their friends list.
Any ideas as to what the issue might be please?
thanks ob
Have you added the publish_stream to your permissions? I use these permissions in my own website and it works just fine:
public function FBConnect()
{
super();
//Set applicationid
_applicationID = "YourID";
//Set permissions to ask for
_extendedPermissions = {perms:"read_stream, publish_stream, user_about_me, read_friendlists, user_photos"};
//Initialize facebook
Facebook.init(_applicationID);
}
Secondly, do you have the accestoken? publishing to a stream is only allowed when you have this token. this is how I publish to a stream:
public function post(_message:String):void
{
var _params:Object = new Object();
_params.access_token = Facebook.getSession().accessToken;
_params.message = _message;
Facebook.api("/" + _user + "/feed", messagePosted, _params, "POST");
}
last of all, but i don't think this will be a problem because you can update statuses already: you know that GraphApi only works online? (or with some adjustments, it also works on localhost).
that's about it i guess, i can't think of anything else. any other questions: always welcome :)
精彩评论