views:

67

answers:

1

I managed to build a basic IFrame application, using the Graph API. I wanted to be able to load this application via Fans Pages' tabs - Only to realize Facebook doesn't like the idea of using iframes under said tabs. (I know of a workaround, which is not acceptable...)

So I gather I should start over doing it a Static FBML Application, and not IFrame - for meeting my tabs requirement. My question is... where do I start? How do I auth a specific application?

any helpful references/guides will be very appreciated. (avoid links to Facebook's documentation, they're sad.)

Thanks, Doori Bar

+1  A: 

How to prompt a user to authorize an app from FBML:

<fb:if-is-app-user> 
    <fb:else>
        <a href="http://www.facebook.com/login.php?api_key={$fbApiKey}&amp;v=1.0"&gt;Authorize This App</a> 
    </fb:else> 
</fb:if-is-app-user>

How to ask for extra permissions:

First you will need to check from PHP FB Api if user has granted you required permissions, if not, then pass some flag to FBML to display this code:

<fb:if-is-app-user> 
    <?php 
        if($noPermissionFlag) {
            echo '<fb:prompt-permission perms="publish_stream,email">Would you like to allow this app posting to your wall?</fb:prompt-permission>';
        }
    ?>
</fb:if-is-app-user>

That's how it would work in a regular FBML canvas app. Not sure about putting this in tab.

serg
So bottom line, what you're saying... I did choose the right path - IFrame Application. Because there is no alternative to make it happen as a "tab". So my options are: 1. use the iframe workaround, for using my iframe application inside a tab. or 2. making a tab which has a link, asking the user to goto my http://apps.facebook.com/<app-name> ... right? (that's a tough call)
Doori Bar
@Doori Bar: You never said what exactly your app is doing besides asking for permissions. Why would someone want to install it to their profile anyway? The workflow is like this: 1. User goes to your main app, authorizes it, grants permissions. 2. If he likes it, he can install a tab app to his profile (tab app is a just a subpage of main app, /tab.php). If I visit a user who installed your tab app and I like it - I go to your main app, authorize it, grant permission and install your tab app to my profile.
serg
@serg555: Thank you, Thank you, Thank you. Without you elaborating the manner, I would've wasted days before I'd come to realize I'm actually going nowhere. Regards my application, it's actually an INFORMATIVE application, which has the ability of publishing contents to the users who granted extended permissions. (the app gives contents)
Doori Bar
@Doori Bar: You are welcome. Just consider tab application to be "my profile" page of your main application. Lets say your app is posting news on user selected topics. I would make a tab that displays news that were selected by the user who installed it. If a visitor likes what he sees and wants his own news - instead of asking him to authorize your app and subscribe to his own news topics right in someone else's tab (again not sure if it is even possible) - I would rather forward him to main app where he can personalize his own tab.
serg
Again, You're the best :)
Doori Bar

related questions