Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do any type of info sharing from within a Facebook tab?

Firstly apologies for the length of this question, and for asking about the Facebook API (seemingly one of the most inconsistent API's in the world...).

The Situation: We're producing an Facebook product 'community' - type page for our client, featuring standard Facebook tabs, one of which embeds a Flash game. At the end of this game we'd like to be able to share the users' final score via a wall post, and also invite friends to challenge the score.

Firstly - the client is insistent that the game appears on a tab within the page, so moving this all to an application (for example, apps.facebook.com) is sadly not an option. I'm aware you can embed an application on tab instead of static FMBL, but I have tried this and the result is essentially the same or fails (the tab imposes stringent restrictions on what can be rendered, enforcing the use of FBML and negating the FB:Iframe tag for starters).

Currently we're embedding this game on a static FBML tab, using the fb:swf tag and FBJS-bridge to enable some simple interaction on the tab (navigating to a new window, etc.). We've also tried the FBJS embed approach, and making the game into an application and adding that as a tab on the page. In all cases, there seems to be no way to get the UID of the viewing user when in the tab environment (despite the fact that they must be logged in to see the page in the first place). The game itself is Flash ActionScript 3, and I've got the option to use the Facebook ActionScript 3 API. Using this approach the best process I've managed to come up with so far is outlined below:

0) Create a separate application with the sole purpose of dealing with score sharing, etc.

1) User Clicks 'Share my score' at the end of the game on the TAB page.

2) SWF does the standard Facebook 'login to application' request by opening a new tab.

3) The user confirms this action and closes the new window.

4) THe user clicks yet again within the Flash game to confirm that they have logged in.

5) SWF performs the facbook.verifySession() and opens yet another window requesting permission to post on the users' wall.

6) The user confirms this and is once again taken back to the game.

7) SWF listens for 'FacebookEvent.PERMISSIONS_CHANGED' and posts to the wall once this is confirmed.

Since there is no way to verify whether the user has added the application when loading within it a tab, it's likely they would have to follow this process every time they wanted to post a result from the game, which is hideous. The main problem seems to be that any RIA residing on a Facebook tab receives no useful information within the OAuth token for that tab, in contrast to an RIA sitting on apps.facebook.com which gets all the information I need within the request headers.

Put simply, I need the simplest, most straightforward way to make a Facebook wall post from within a Facebook Product page tab, whether using FMBL, FBJS, ActionScript 3, ASP or any combination thereof.

I've seen this: https://stackoverflow.com/questions/3674923/facebook-share-or-publish-dialogue-from-page-tab-closed which is indeed the same question I'm asking, but the answer is unclear, and it doesn't seem that it would solve my problem.

like image 813
bharling Avatar asked Nov 15 '22 07:11

bharling


1 Answers

FB tab application SWFs receive a session key in flashvars, which can be exchanged for an oauth token! http://fraserhobbs.com/2010/07/flash-facebook-graph-api-in-tabs/ Really helped me out.

like image 148
crickkills Avatar answered Mar 06 '23 15:03

crickkills