Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 发布给朋友';使用facebookapi的防火墙_Php_Facebook_Facebook Graph Api - Fatal编程技术网

Php 发布给朋友';使用facebookapi的防火墙

Php 发布给朋友';使用facebookapi的防火墙,php,facebook,facebook-graph-api,Php,Facebook,Facebook Graph Api,我知道我们可以用这个在朋友的墙上发布一些东西: $publishStream = $facebook->api("/$user/feed", 'post', array( 'message' => "Your Message", 'link' => 'http://example.com', 'picture' => '', 'name' => 'App Name', 'description'=>

我知道我们可以用这个在朋友的墙上发布一些东西:

$publishStream = $facebook->api("/$user/feed", 'post', array(
     'message' => "Your Message", 
     'link'    => 'http://example.com',
     'picture' => '',
     'name'    => 'App Name',
     'description'=> 'App description'
));
只需将$user变量替换为好友的用户id即可

我只想在我的朋友中选择我想用复选框写的用户配置文件

例如,如果你想共享一个粉丝页面,这已经是可能的了。您可以选择向其发送请求的人


提前感谢您的帮助

您可以使用Facebook的多好友选择器(MFS)

一个编辑过的示例取自多好友选择器文档

function renderMFS() {
 // First get the list of friends for this user with the Graph API
 FB.api('/me/friends', function(response) {
   var container = document.getElementById('mfs');
   var mfsForm = document.createElement('form');
   mfsForm.id = 'mfsForm';

   // Iterate through the array of friends object and create a checkbox for each one.
   for(var i = 0; i < Math.min(response.data.length, 10); i++) {
     var friendItem = document.createElement('div');
     friendItem.id = 'friend_' + response.data[i].id;
     friendItem.innerHTML = '<input type="checkbox" name="friends" value="'
       + response.data[i].id
       + '" />' + response.data[i].name;
       mfsForm.appendChild(friendItem);
     }
     container.appendChild(mfsForm);

     // Extract selected friends' Facebook ID from value property of checked checkboxes

     // Do a for loop to send notification (refer to the link posted below) and publish post to each user's wall
   });
 }
函数renderMFS(){
//首先使用Graph API获取此用户的好友列表
FB.api('/me/friends',函数(响应){
var container=document.getElementById('mfs');
var mfsForm=document.createElement('form');
mfsForm.id='mfsForm';
//遍历friends对象数组,并为每个对象创建一个复选框。
对于(变量i=0;i

是否可以在发送消息之前发送通知 写在墙上


是的,当您拥有Facebook ID时,这是可能的。请参阅我在

中的答案,您可以使用Facebook的多朋友选择器(MFS)

一个编辑过的示例取自多好友选择器文档

function renderMFS() {
 // First get the list of friends for this user with the Graph API
 FB.api('/me/friends', function(response) {
   var container = document.getElementById('mfs');
   var mfsForm = document.createElement('form');
   mfsForm.id = 'mfsForm';

   // Iterate through the array of friends object and create a checkbox for each one.
   for(var i = 0; i < Math.min(response.data.length, 10); i++) {
     var friendItem = document.createElement('div');
     friendItem.id = 'friend_' + response.data[i].id;
     friendItem.innerHTML = '<input type="checkbox" name="friends" value="'
       + response.data[i].id
       + '" />' + response.data[i].name;
       mfsForm.appendChild(friendItem);
     }
     container.appendChild(mfsForm);

     // Extract selected friends' Facebook ID from value property of checked checkboxes

     // Do a for loop to send notification (refer to the link posted below) and publish post to each user's wall
   });
 }
函数renderMFS(){
//首先使用Graph API获取此用户的好友列表
FB.api('/me/friends',函数(响应){
var container=document.getElementById('mfs');
var mfsForm=document.createElement('form');
mfsForm.id='mfsForm';
//遍历friends对象数组,并为每个对象创建一个复选框。
对于(变量i=0;i

是否可以在发送消息之前发送通知 写在墙上


是的,当你有Facebook ID时,这是可能的。请参阅我在

中的回答,集体向新闻源写信可能会被视为垃圾邮件。考虑使用请求系统:在消息被写在墙上之前,是否可以发送通知?它是,但这是围绕问题而不是面对它。饲料不打算以这种方式使用。如果您希望一个用户能够向多个用户发送消息,请使用请求系统,而不是提要。集体写入新闻提要可能会被视为垃圾邮件。考虑使用请求系统:在消息被写在墙上之前,是否可以发送通知?它是,但这是围绕问题而不是面对它。饲料不打算以这种方式使用。如果希望用户能够向多个用户发送消息,请使用请求系统,而不是提要。