我正在尝试在Facebook页面上传视频,其中包含号召性用语按钮和Facebook php sdk中的链接,但是上面没有通过号召性用语上传是我的代码
if ($token) {
$this->fb->setDefaultAccessToken($token);
if ($args["img"]) {
$linkData = ["source" => $args["img"], "message" => $args["post"]];
$this->fb->post('/' . $user_details[0]->net_id . '/feed', $linkData, $token);
return true;
} elseif ($args["video"]) {
$linkData = ["source" => $this->fb->videoToUpload($args["video"]), "title" => $args["post"], "call_to_action" => array("type" => "SHOP_NOW", "value" => array("link" => "http://example.com"))];
$this->fb->post('/' . $user_details[0]->net_id . '/videos', $linkData, $token);
return true;
} elseif ($args["url"]) {
$linkData = ["link" => $args["url"], "message" => $args["post"]];
$this->fb->post('/' . $user_details[0]->net_id . '/feed', $linkData, $token);
return true;
} else {
$linkData = ["message" => $args["post"]];
$this->fb->post('/' . $user_details[0]->net_id . '/feed', $linkData, $token);
return true;
}
} else {
return false;
}