2011-04-22 112 views
0
I like to post data from application to many users who have granted the application. 
I tried in following steps. 

step:1 first get access_token as an application by following. 
https://graph.facebook.com/oauth/access_token?  
client_id=XXXXXX&client_secret=YYYYYYYYYYYY&grant_type=client_credentials 

step2: 
    $facebook = new Facebook("KEY","SECRETKEY"); 
    $param = array(
     'method' => 'stream.publish', 
     'message' => 'aaaaaaaaaaaaaaa', 
     'target_id' => 'ZZZZZZZZZZZZZZ', 
     'attachment' => $attachment, 
     'access_token' => GENERETED ACCESS TOKEN FROM STEP1 , 
     'callback' => '' 
    ); 

    $fqlResult2 = $facebook->api("/IIIIIIIIIIIIIIIII/feed/" , "post", $param); 

but the application cant post to the targeted users wall how can i achieve? 
The error was "User not visible". 

but works for the code given below:[retrieve user info] 
$fql = "select name, hometown_location, sex, pic_square, email from user where  
      uid=1000000001"; 
$param = array(
    'method'  => 'fql.query', 
    'query'  => $fql, 
    'access_token' =>GENERETED ACCESS TOKEN FROM STEP1 , 
    'callback' => '' 
); 

$fqlResult2 = $facebook->api($param); 

so how can application can post the specified users wall/newsfeed?the above code was wrong? 
+0

我得到了,没问题,但现在,应用程序可以发布给授予该应用程序的用户墙,但是当应用程序发布到用户墙上时,然后显示recepient的名称和图片,但我想显示不同的粉丝页徽标和自定义标题 – msaif 2011-04-22 06:29:08

+0

我如何更换标志和标题 – msaif 2011-04-22 06:39:17

回答

0

错误“用户不可见”意味着用户的隐私设置阻止您在他们的墙上张贴。

此外,您正在使用已弃用的旧REST API。你应该使用Graph API

+0

用户的隐私设置允许但(#210)用户不可见错误 – msaif 2011-04-22 03:05:30