0

我可以上传照片并包含 Graph API 的链接吗?我只想像 Instagram 应用一样包含指向原始帖子的链接。我希望它看起来像这样:

picture-name -- http://myhost.com/link/to/original/post

我的代码是这样的:

$post_link = get_permalink($post_id);

$file='sample.jpg';
$photo_details = array(
    'message'=> 'Photo message',
    'source' => '@' . realpath($file)
);

$upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details);

我可以将我的图片上传到 Facebook 相册,但我想在Photo message.

4

1 回答 1

0

你的意思是你只需要像这样将链接附加到当前消息吗?

   $post_link = get_permalink($post_id);

   $file='sample.jpg';
   $photo_details = array(
   'message'=> 'Photo message - '.$post_link,
   'source' => '@' . realpath($file)
     );
   $upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details);
于 2012-08-06T12:39:50.713 回答