3

Fb APIFacebookの投稿フィードに使用しています。

私のコードは -

            if (response.authResponse) {                   
                var data =
                {
                    name: "link to apply",
                    picture: 'http://www.hrgp.biz/Uploads/CompanyForTesting_499/NotesReminders/2608chemtec-logo.jpg',
                    link: "http://www.hrgp.biz/bc0efdb3-f1a7-4d81-9635-d1418e808b6d.aspx",  // Go here if user click the picture
                    description: "thank you"                        
                }
                FB.api('me/feed', 'post', data, function (response) {
                    if (!response || response.error) {
                        alert(JSON.stringify(response.error));
                    } else {
                        //alert('Post ID: ' + response.id);
                        alert('feed posted successfully.');
                    }
                });                   
            }
        }, { scope: 'email,user_likes,publish_actions,publish_stream,read_stream,photo_upload' });

このコードは機能しますが、画像に問題があります。投稿には反映されません。

どうすればこの問題を解決できますか? または、私のコードに問題があるかどうか教えてください。

ありがとうございました..!!!

4

2 に答える 2

1

Facebook Open Graph 画像の幅と高さの最小値は? を参照してください。.

高さを幅で割った値と幅を高さで割った値の比率 (w/h, h/w) は 3.0 を超えることはできません。

あなたの写真http://www.hrgp.biz/Uploads/CompanyForTesting_499/NotesReminders/2608chemtec-logo.jpg、250/65 = 3.84615384615 は明らかに最大比率を超えています:

ここに画像の説明を入力

于 2013-05-21T08:56:37.467 に答える
0
FB.api('me/feed', 'post', { message: body,
                            picture :'PICTURE_URL',
                            description : "DESCRIPTION"
                            }
                    , function (res) {
    if(!res || res.error) {
        console.log(!res ? 'error occurred' : res.error);
        return;
    }
    console.log('Post Id: ' + res.id);

その他のオプションについては、https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feedを確認してください。

于 2014-06-20T10:11:32.670 に答える