我正在尝试通过我的应用程序发布一个故事。但是当我这样做时,它会显示“有人共享了链接应用程序名称”
我不希望它作为链接共享,而是如下图所示
通读facebook 文档(https://developers.facebook.com/docs/reference/api/post/)我认为可以通过将 status_type 定义为 app_created_story 来实现,但不幸的是这也无济于事。其次,我还希望在第二张图片中的故事下方有“立即尝试”按钮。我假设它是通过“动作”(包含名称和链接的对象数组)完成的,但我无法达到预期的结果。在这方面的任何帮助将不胜感激。
我的代码如下
$attachment = array(
'access_token'=> "User Access Token",
'message' => "Message",
'name' => 'Title',
'caption' => "Some text",
'link' => 'https://apps.facebook.com/canvas/',
'description' => 'Some Text Here',
'picture' => "http://www.example.com/image.jpg",
'from' => "application id",
'status_type' => "app_created_story",
);
try {
// Proceed knowing you have a user who is logged in and authenticated
$result = $facebook->api("/userid/feed/",'post',$attachment);
} catch (FacebookApiException $e) {
error_log($e);
//$user = null;
}
只需添加访问令牌,我就有以下三个扩展权限:&scope=email,publish_stream,publish_actions