dongluo8439 2016-02-02 10:09
浏览 21
已采纳

如何在Facebook PHP SDK上发布.swf

I am trying to post a .swf using PHP SDK 5.2. I have tried a few methods.
For example:

$linkData = [
'type'=> "video",
'source'=> "https://mysite/my_file.swf",
'name'=> $_GET['message1'],
'caption'=> $_GET['caption'], 
'description'=> $_GET['message2'],
'message' => $_GET['message3']
];
try {
    $response = $fb->post('/me/feed', $linkData, $user->access_token);
  } catch(Facebook\Exceptions\FacebookResponseException $e) {
    $this->ueoutputs['errors'][] = $e->getMessage();
    exit;
  } catch(Facebook\Exceptions\FacebookSDKException $e) {
    $this->ueoutputs['errors'][] = $e->getMessage();
    exit;
  }

it gives me a Facebook\Exceptions\FacebookResponseException:

Template data must be a JSON-encoded dictionary, of the form {'key-1': 'value-1', 'key-2': 'value-2', ...}

How to solve this?

  • 写回答

2条回答 默认 最新

  • duanmei1694 2016-02-19 12:31
    关注

    The solution to this is using the Open Graph Protocol. Here is an example:

    <meta property="og:audio" content="http://example.com/bond/theme.mp3" />
    <meta property="og:description" 
      content="Sean Connery found fame and fortune as the
               suave, sophisticated British agent, James Bond." />
    <meta property="og:determiner" content="the" />
    <meta property="og:locale" content="en_GB" />
    <meta property="og:locale:alternate" content="fr_FR" />
    <meta property="og:locale:alternate" content="es_ES" />
    <meta property="og:site_name" content="IMDb" />
    <meta property="og:video" content="http://example.com/bond/trailer.swf" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程