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条)

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)