【问题标题】:Upload notes fanpage with grap api facebook使用graph api facebook上传notes fanpage
【发布时间】:2012-12-27 04:11:45
【问题描述】:

您好,我正在使用此代码在我的粉丝页面上发布注释,它可以工作,问题是日记页面不显示图像,而只有文字,为什么?

<?php
$access_token='MY ACCES TOKEN FAN PAGE';
$attachment = array(
'access_token' => $access_token,
'message' => 'MESSAGE <img src="IMAGE_ADDRESS" alt="TEST IMAGE" /> ',
'subject' => 'test test test'
);

// set the target url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/id_fanpage/notes?');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); //to suppress the curl output

$result= curl_exec($ch);
curl_close ($ch);

【问题讨论】:

    标签: php facebook api facebook-graph-api facebook-javascript-sdk


    【解决方案1】:

    你是如何上传图片的?

    似乎notesmessage 字段接受 HTML 标记,因此具有如下内容应该可以工作:

    <img src='http://domain.com/myImage.jpg' />
    

    【讨论】:

    • 图像,从我插入带有 html 标签 的消息字段的代码中可以看出,问题是日记页面不显示任何预览图像,但如果我点击注意显示图像,我该如何解决这个问题?
    • 那么当您在笔记全视图上时,图像确实会出现?您的消息正文中的图像在哪里?也许如果它在底部预览不会显示它(我之前没有测试过notes api)
    • 对了,在这里看到完整打开便笺时会显示图像'-> facebook.com/pages/Test-page/302269416561381,带有图像的img标签放在“消息”字段中跨度>
    猜你喜欢
    • 2011-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-19
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多