开发者

how to call showPermissionsDialog() in php (facebook api)?

I was reading over the documentation yet I could not figure out how to call Facebook.showPermissionsDialog() in php

include_once './facebook-platform/php/facebook.php';
$facebook = new Facebook(my api keys go here);
$fb_user = $facebook->require_login();
/*this is where i want it to go */
$facebook->api_client->stream_publish("开发者_如何学编程test");

How would I go about doing this?


You can't call it in PHP, since it's a Javascript function.

You can't trigger the browser to change the DOM from a server-side language.


$userId = $facebook->require_login($required_permissions = 'publish_stream');

should do the job


If you have the permission the post action is something "invisible", if you don't have the permission then you have to pop up the Facebook dialog and ask for that permission (but you have to use also javascript and not only php).

Here is a tutorial that explains how to post to your wall:

http://www.barattalo.it/2010/01/17/posting-to-facebook-from-website-with-facebook-connect/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜