0

我正在尝试.swf使用 PHP SDK 5.2 发布。我尝试了几种方法。
例如:

$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;
  }

它给了我一个Facebook\Exceptions\FacebookResponseException

模板数据必须是 JSON 编码的字典,格式为 {'key-1': 'value-1', 'key-2': 'value-2', ...}

如何解决这个问题?

4

2 回答 2

0

尝试更改/me/feed/me/videos. 这个对我有用。

    $response = $fb->post('/me/videos', $linkData, $user->access_token);
于 2016-02-02T10:37:37.820 回答
0

解决方案是使用Open Graph Protocol。这是一个例子:

<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" />
于 2016-02-19T12:31:39.063 回答