Closed GoogleCodeExporter closed 9 years ago
Have you tried setting the request method to "POST"? If you look at the docs:
http://facebook-actionscript-api.googlecode.com/svn/release/current/docs/index.h
tml
you'll see the signature for the api method is:
public static function api(method:String, callback:Function, params:* = null,
requestMethod:String = GET):void
which defaults to a requestMethod of GET. You want to do a POST. Try the
following:
FacebookDesktop.api('/'+intData.id+'/likes', handlePostLiked, null, "POST");
Original comment by alan...@gmail.com
on 11 Oct 2010 at 4:41
yes, I changed GET to POST and its works but there is one problem,
if I got like, then it is impossible to make unlike.
how to solve this issue??!!
my script looks like this:
if (intData.user_likes) {
FacebookDesktop.api('/'+intData.id+'/likes', handlePostUnliked, null, 'POST');
}else {
FacebookDesktop.api('/'+intData.id+'/likes', handlePostLiked, null, 'POST');
}
thanks
Original comment by 22ro...@gmail.com
on 11 Oct 2010 at 5:31
To unlike, instead of POST, use DELETE.
You can also take a look here:
http://developers.facebook.com/docs/api
Original comment by alan...@gmail.com
on 14 Oct 2010 at 6:18
Original comment by edwar...@gmail.com
on 12 Jan 2011 at 10:56
all works ok!
Original comment by 22ro...@gmail.com
on 13 Jan 2011 at 7:30
I'm trying to like a page/post, like you have done, using Facebook.api()
instead of FacebookDesktop.api() but I always receive this error:
"error":{"type":"OAuthException","message":"(#200) App does not have permission
to make this call"
even if I've set ALL the permission.
This is my code
protected function LikePage(e:MouseEvent):void {
var values:URLVariables = new URLVariables();
values.url = "http://www.facebook.com/pages/MY_PAGE/MY_PAGE_ID";
Facebook.api('/MY_PAGE_ID/likes', handleLikePosted, values, 'POST');
}
protected function handleLikePosted(response:Object, fail:Object):void {
if (response) {
debug.appendText("handleLikePosted\n");
}
}
Where I'm going wrong??? Anybody can help me??
Thanks
Original comment by assurda...@gmail.com
on 8 Mar 2011 at 2:55
Hi,
i tried it but i does not work for me. My Alert will be not shown.
Facebook.api('/'+intData.id+'/likes', handlePostUnliked, null, 'DELETE');
protected function handlePostUnliked(result:Object, fail:Object):void {
Alert.show("TEST");
Original comment by gulsun.falke@gmail.com
on 8 Jun 2011 at 3:30
gulsun.falke, you need to pass in some params in your call. Ex)
var params:Object = {method: URLRequestMethod.DELETE};
Facebook.api('/'+intData.id+'/likes', handlePostUnliked, params,
URLRequestMethod.POST);
Original comment by rovertn...@gmail.com
on 10 Jun 2011 at 7:23
Original issue reported on code.google.com by
22ro...@gmail.com
on 9 Oct 2010 at 12:41