Adding a ‘Become a fan’ button to a FBML Facebook app.
I’ve had a few emails asking about how to get the ‘Become a fan’ button in a FBML app. It is something that had me a little puzzled initially as there is no FMBL tag or FBJS command to do it easily.
It is not a problem adding the button if your application is an ‘Iframe’ app but I use Facebooks mark-up language quite extensively.
Thankfully the solution is actually very easy. Here is the code:
<fb:iframe scrolling=”no” frameborder=”0″ src=”http://www.facebook.com/connect/connect.php?id=APPLICATION_ID&connections=0&stream=0&locale=your_LOCALE”
allowtransparency=”true” style=”border: none; width: 300px; height: 60px;”></fb:iframe>
Simply replace APPLICATION_ID with your applications ID. You can see this in action on the PLAY screen and the HELP screen of this app: http://apps.facebook.com/prizeslots/
