通过带有object_attachment的API制作的/ page / feed帖子显示空白方块,其中照片应为

时间:2017-06-27 14:36:41

标签: facebook facebook-graph-api

使用此代码,

    $fb = new Facebook\Facebook([
        'app_id'                => FB_APP_ID,
        'app_secret'            => FB_APP_SECRET,
        'default_graph_version' => 'v2.9'
    ]);

    //Post property to Facebook
    $linkData = [
        'link' => 'http://www.example.com/',
        'message' => 'test message',
        'object_attachment' => 111111111111111
    ];

    try {
        $response = $fb->post('/mypageid/feed', $linkData, FB_APP_ACCESS_NON_EXPIRES);
    } catch(Facebook\Exceptions\FacebookResponseException $e) {
        echo 'Graph returned an error: '.$e->getMessage();
        exit;
    } catch(Facebook\Exceptions\FacebookSDKException $e) {
        echo 'Facebook SDK returned an error: '.$e->getMessage();
        exit;
    }
    $graphNode = $response->getGraphNode();

我得到了这个结果:

Missing the photo included

我做错了什么?

0 个答案:

没有答案