views:

639

answers:

3

I am working on a Flex AS3 application and wanted to add the Facebook Like button inside the app. I am unable to find any API or anything apart from the http://developers.facebook.com/docs/reference/plugins/like code generator.

Any ideas on how this might be accomplished? I am quite new to the recent changes in the Facebook Platform, so any info would be appreciated.

A: 

I hate answering "no" to a question because what I really mean is "I don't know and I can't find a way". I'm sure your Google-fu is as good as mine. All I can see are Facebook forum posts like this where people are asking the same question and no one is answering.

The examples they give of the like button are either embedded in iFrames or using XFBML <fb:like ../> tag. There are no examples of how to like something using their new graph api or either of their old APIs (FQL and REST API).

James Fassett
Which I find quite weird. All the talk about APIs and not a single hint for the Like button.
Abhinav
It makes sense. If there was a way to do it ... it would be a security hole. The like button does not ask for authorization/permission if the user is already logged in to Facebook ... now remember those flash ads you see that tell you click really fast to win a prize ? Someone can maliciously place the like call (if there was one) in the button of their choosing. Not cool.
phwd
Hmm. Why not allow the Like API only through apps authorized by Facebook and ask for the 'Liking' permission on connecting with FB? This is one way you can prevent it's misuse. Unless FB wants the Like button itself to reflect the FB brand, I think an API can be provided.
Abhinav
Can you not show it in a iframe/web snippet embeded in your app? Not great...
Rodney
Hmm. I don't think that's feasible. Will have to take care of where to display the button.
Abhinav
A: 

I'm searching for it but only found this. Hope it will be helpfull. But i learned i must use html for fblike :(

Xenon
A: 

A direct "like" button should not be possible, since Facebook needs to sandbox the whole thing. Both like button formats (iframe and xfbml) use a sandboxed iframe, so nobody but facebook can set "likes" or know anything about the user.

For that to work with Flash, I think facebook would have to provide the button itself as a SWF file so you can load it in Flash. Then it can create a sandbox within itself and thus load the user information safely. Very much like the Chromeless Youtube Player, where it's almost impossible for Flash to access the actual FLV URL (even through introspection). But even so, I don't think this would provide enough security... realize that you are dealing with very private user information and credentials here.

The only way I know you can "like" stuff through Flash is first doing the whole Facebook Connect thing (several popup windows asking the user for permissions) and then using the API of your choice to do the actual "liking", for instance, with the Graph API:

http://developers.facebook.com/docs/api#publishing

Cay
Couldn't find anything in the Graph API which would let you like stuff using FB Connect.
Abhinav
follow my link: "You can comment on or like a post by posting to https://graph.facebook.com/POST_ID/comments and https://graph.facebook.com/POST_ID/likes, respectively:..."
Cay
Hmm. What I wanted was to create a new entity which can be liked independent of the person's profile. This would be good for liking comments/likes related to the person.
Abhinav