facebook api (java or php): how to request the user to add the application when he opens it?
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 n开发者_如何学运维ot, to open a window that allows him to add the application ?
thanks!
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.'&v=1.0&ext_perm=create_event", "Permission");</script>';
echo'<meta http-equiv="refresh" content="0; URL=javascript:history.back();">';
exit;
}
?>
精彩评论