开发者

facebook application users wall post

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?


The error "user not visible" means the user's privacy settings prevent you from posting on their wall.

Also, you're using the old REST API which has been deprecated. You should be using the Graph API

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜