How can I make my Unity application work inside Facebook?

I'd like to embed my Unity application inside Facebook. Can someone tell me the best way of doing that?

Integrating with facebook requires some knowledge of the facebook API and some external calls (JavaScript communication between webplayer and its container webpage). The guys from CMUNE are giving a talk about how to accomplish this at Unite '09, so that is definitely worth checking out. If you do not plan on attending Unite then video recordings of the sessions will as always be available at some point after Unite.

If you feel like jumping in right now, you should read up on communicating with a website and the facebook API.

There is also a video tutorial up here:

It depends. If you are running in IFRAME mode then you can just embed it as normal and run Facebook Connect on the site to pass in the facebook data. You can check out Facebook's javascript apis for this.

If you are using FBML they have specific tags like fbml:swf for flash but not unity. You can use an iframe in FBML though like .

But I recommend you use an iframe setup in facebook developer because you can use just about any facebook javascript library or server side library with it. Also, you can and easily use other tools like jquery and other scripts you might have without worrying about conflicts or integration, also there is less FBML that way (and less lockin to facebook).

Facebook JavaScript Client Library


Lookup 'facebookjsapi' on Google Code I use this frequently just to pull basic content out like profile info and friends or friends with the app - that is really all you need then just run the rest like you normally would on your site.

One of the easiest ways is probably with dimeRocker Arcade. They have a Unity API that takes care of all the facebook integration for you.

Disclaimer: I'm not affiliated with dimeRocker, and I've only read their docs, I haven't tried it out for myself. Let us know if you do, I'm curious to know more.