当用户使用我网站上的应用程序时,如何发布到Facebook用户墙? [英] How to publish to a Facebook User's wall when user uses the App from my website?

查看:63
本文介绍了当用户使用我网站上的应用程序时,如何发布到Facebook用户墙?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PHP创建了一个Facebook应用程序,该应用程序允许用户将照片上传到我的Facebook页面.

I created a Facebook Application using PHP that allows user to upload photos to my facebook page.

现在,我希望每当用户通过此Facebook应用程序在我的墙上发布时-提示用户在他/她的墙上发布一条消息,例如约翰发布了邪恶猴墙的图片".始终让用户提示是否接受.

Now I want that whenever the user posts on my wall via this Facebook application - the user is prompted to publish a message on his/her wall such as 'John has posted a picture of Evil Monkey's Wall'. Always let the User prompt whether to accept this or not.

可以做到这一点并将其集成到我现有的Facebook应用程序中吗?能否请您提供一些示例代码?

Can this be done and integrated into my existing Facebook Application please? Can you please provide me with some sample code?

谢谢.

推荐答案

来自 https: //developers.facebook.com/docs/reference/dialogs/feed/

<script> 
  FB.init({appId: "YOUR_APP_ID", status: true, cookie: true});

  function postToFeed() {

    // calling the API ...
    var obj = {
      method: 'feed',
      link: 'https://developers.facebook.com/docs/reference/dialogs/',
      picture: 'http://fbrell.com/f8.jpg',
      name: 'Facebook Dialogs',
      caption: 'Reference Documentation',
      description: 'Using Dialogs to interact with users.'
    };

    function callback(response) {
      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
    }

    FB.ui(obj, callback);
  }

</script>

这篇关于当用户使用我网站上的应用程序时,如何发布到Facebook用户墙?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆