Facebook 应用程序在用户墙上发布许可(发布/跳过)php sdk

发布于 2024-10-25 02:29:24 字数 904 浏览 1 评论 0原文

我正在创建一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雨轻弹 2024-11-01 02:29:24

您应该使用 FB.ui

 FB.ui(
   {
     method: 'feed',
     name: 'Facebook Dialogs',
     link: 'http://developers.facebook.com/docs/reference/dialogs/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
     message: 'Facebook Dialogs are easy!'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 );

要对此进行测试,请转到测试控制台 ->单击示例 ->然后从 fb.ui 列表中选择 feed

You should use FB.ui:

 FB.ui(
   {
     method: 'feed',
     name: 'Facebook Dialogs',
     link: 'http://developers.facebook.com/docs/reference/dialogs/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
     message: 'Facebook Dialogs are easy!'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 );

To test this, go to the Test Console -> Click on the Examples -> And then from the fb.ui list choose feed.

梦里兽 2024-11-01 02:29:24

为此,您可以使用 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/

_失温 2024-11-01 02:29:24

我不确定,但只要我能猜到您需要访问令牌才能在用户墙上发布。

$token = $facebook->getAccesstoken();

$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',
    'access_token' =>$toekn);

我希望如此

I am not sure but you as long as i can guess you need access token to post on user wall.

$token = $facebook->getAccesstoken();

$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',
    'access_token' =>$toekn);

i hope it

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文