1

我有一个可以将(消息、链接、图像)发布到用户墙
的 facebook 应用程序当我看到用户墙或主页时,标语(通过状态应用程序名称)没有出现
这是代码

          // in case of image
        $image = "image url"
        $attachment = array(
            'message' => $message,
            'source' => $image,
            'url' => $image
        );
        $photo = true;
   // in case of youtube link
        $attachment = array(
            'message' => $message,
            'link' => 'http://www.youtube.com/watch?v=' . $video_id,
            'source' => 'http://www.youtube.com/v/' . $video_id,
            'description' => $description,
            'picture' => 'http://img.youtube.com/vi/' . $video_id . '/0.jpg',
        );
    //incase of text
        $attachment = array(
            'message' => $message,
            'name' => $title,
        );
    }
foreach($users as $uid=>$token){
    $attachment['access_token'] = $token;
    if (isset($photo)) {
                $facebook->setFileUploadSupport(true);
                $fb_result = $facebook->api('/' . $uid . '/photos', 'post', $attachment);
            } else {
                $fb_result = $facebook->api('/' . $uid . '/feed/', 'post', $attachment);
            }
}
4

0 回答 0