tags:

views:

24

answers:

1

Hiya. I've created a facebook application using flex.

i tried server side both with apache-tomcat and tinyfbclient, and with php and using the php facebook api.

i can't fetch the user info if the user did not add my application. how can i check if the user added my application to his facebook profile and if not, to open a window that allows him to add the application ?

thanks!

+1  A: 

Try something like this via the PHP API. I needed the user to give me permission so that I could create events via my web app.

<?php
if(!$facebook->api_client->users_hasAppPermission('create_event')){
        echo'<script type="text/javascript">window.open("http://www.facebook.com/authorize.php?api_key='.FB_API_KEY.'&amp;v=1.0&amp;ext_perm=create_event", "Permission");</script>';
        echo'<meta http-equiv="refresh" content="0; URL=javascript:history.back();">';
        exit;
    }
?>
PHPology
Don't use `authorize.php` -- it is a very very old way of doing it. You should instead use the OAuth2 enabled authorization flow: http://developers.facebook.com/docs/authentication/
daaku