Facebook 应用程序在用户墙上发布许可(发布/跳过)php sdk
我正在创建一个 Facebook 应用程序。我管理了一个扩展的发布流应用程序。我想在用户的墙上显示应用程序结果。执行下面的方法,它会自动发布在用户的墙上,我想通过发布/跳过对话框来完成此操作。有人可以帮助我吗?多谢!!
$facebook->api('/me/feed', 'post', array(
'message' => message,
'name' => $fbme['first_name'],
'description' => 'here goes description',
'caption' => 'this is caption',
'picture' => $imageurl,
'link' => 'some link here',
//下一部分,邀请朋友。我希望当用户单击“发布/跳过”时,才会出现一个对话框窗口来请求邀请朋友。我尝试这样做,但它不起作用。
function(response) {
if (response && response.post_id) {
alert('Post was published.');
'<?php echo("invitefriends.php")'
} else {
alert('Post was not published.');
'<?php echo("invitefriends.php")'
}
我遇到的问题是我同时打开三个窗口。 informfriends.php 具有与 javascript sdk 示例中提到的相同的代码,并且工作正常。
让我知道在哪里以及如何包含invitefriends.php。
谢谢!!
i am creating a facebook application. i have managed an extended publish stream application. and i want to display the app results on user's wall. doing the method below, it automatically posts on the user's wall, i want to do it through the publish/skip dialog. could anyone please help me. thanks a lot!!
$facebook->api('/me/feed', 'post', array(
'message' => message,
'name' => $fbme['first_name'],
'description' => 'here goes description',
'caption' => 'this is caption',
'picture' => $imageurl,
'link' => 'some link here',
//the next part, inviting friends. i want when the user clicks publish/skip only then a dialog window to apper to request to invite friends. i try it this way, but it does not work.
function(response) {
if (response && response.post_id) {
alert('Post was published.');
'<?php echo("invitefriends.php")'
} else {
alert('Post was not published.');
'<?php echo("invitefriends.php")'
}
the problem i have is i get three windows and all of them simultaneously. invitefriends.php has the same code as mentioned in the javascript sdk example and it works fine.
let me know where and how to include invitefriends.php.
thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该使用
FB.ui
:要对此进行测试,请转到测试控制台 ->单击示例 ->然后从 fb.ui 列表中选择 feed。
You should use
FB.ui
:To test this, go to the Test Console -> Click on the Examples -> And then from the fb.ui list choose feed.
为此,您可以使用 FB 的 JS API
您可以按照本教程
http ://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/
For this you can use FB's JS API
You can follow this tutorial
http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/
我不确定,但只要我能猜到您需要访问令牌才能在用户墙上发布。
$token = $facebook->getAccesstoken();
我希望如此
I am not sure but you as long as i can guess you need access token to post on user wall.
$token = $facebook->getAccesstoken();
i hope it