2011-01-09 4 views
12

저는 FB.ui을 Facebook 사용자 벽에 게시하고 있습니다. 그러나 페이지 또는 응용 프로그램 벽에 게시하는 데 사용할 매개 변수가 확실하지 않습니다. 어떤 링크?FB.ui를 사용하여 페이지 벽에 게시

나는 페이지 에 해당 페이지으로 게시하려고하는데 사용자 계정이 아닙니다.

코드는 사용자 계정에 게시 :

FB.ui(
    { 
    method: 'feed', 
    name: name, 
    link: link, 
    picture: picture, 
    caption: caption, 
    description: redemption, 
    message: message 
    }, 
    function (response) { 
    if (response && response.post_id) { 
     alert(response.post_id); 
    } else { 

    } 
    } 
); 
+0

에서 간단 호출을 사용하여 아래 JS 기능 그림은 무엇을해야 하는가? 내 서버에있는 이미지에 직접 URL을 삽입하고 있지만 표시되지 않습니다. 그게 무슨 뜻이 아니야? – Harry

답변

9

가있어

FB.ui( { 
    method: 'feed', 
    name: name, 
    link: link, 
    picture: picture, 
    caption: caption, 
    description: redemption, 
    message: message, 
    to: page_id, 
    from: page_id  
},  
function (response) { 
    if (response && response.post_id) { 
     alert(response.post_id); 
    } else { 

    }  
    } 
); 
+0

이 코드는 작동하지 않습니다. (사용자가 먼저 페이지를 좋아하지 않았다면) 또한 대화 상자의 피드는 페이지 관리자 만 작동하는 특별한 경우입니다. http://developers.facebook.com/docs/reference/dialogs/feed/ –

+0

이것은 나에게 적합하지 않습니다. - 내가 페이지의 ID가되도록 설정하고 있습니다. - 페이스 북에서 그 페이지를 가장하고 있습니다. 오류 : –

2

내가 사용자의 벽에 게시 자바 스크립트 SDK를 사용 :

function graphStreamPublish(){ 
      var body = document.getElementById("txtTextToPublish").value; 
      FB.api('/me/feed', 'post', { message: body }, function(response) { 
       if (!response || response.error) { 
        alert('Error occured'); 
       } else { 
        alert('Post ID: ' + response.id); 
       } 
      }); 
    } 

당신이 '/me/feed/''pageId/feed'을 변경하면 내가 생각하는 Graph API Page 통과 해당 페이지에 메시지를 게시 할 수 있습니다. 나는 잘 모르겠다. - 단지 제안. 당신이 tofrom 값을 설정해야

:

+1

그래, 그랬어. FB.ui 팝업을 찾고있었습니다. :-) – jchapa

+0

위에서 게시 한 링크를 확인하면 jquery + FB.ui를 사용하여 팝업을 얻는 방법을 보여줍니다. – snipe

+0

이 코드의 문제점은 사용자의 벽에 게시하는 것입니다. 문제는 FB.ui를 사용하여 동일한 내용이 아닌 애플리케이션 페이지에 게시하는 방법입니다. – haskovec

0

죄송합니다,이 오래된 질문입니다,하지만 난이 구글을 통해 찾을 사람들을 위해 도움이 될 줄 알았는데 . http://fbmhell.com/2011/07/facebook-share-popup-iframe-tabs-jquery/

+0

-1이 링크는 더 이상 존재하지 않습니다. – Lumbee

+0

답장은 2 년입니다. 그 점에 대해 -1이 보증되는지 확신 할 수 없습니다. 어쨌든, 업데이트 된 링크는 다음과 같습니다. http://www.snipe.net/2011/07/facebook-share-popup-iframe-tabs-jquery/ – snipe

2

월 2012 년으로, 친구의 벽에 공유하려면 :

FB.ui({ 
    method: 'stream.publish', 
    app_id: appId, 
    display: 'iframe', 
    name: name, 
    link: link, 
    picture: picture, 
    caption: caption, 
    description: description, 
    target_id: friendIds 
}); 
+0

stream.publish 더 이상 사용되지 않을 예정입니까? – superscral

+0

예. 불행히도 새로운 솔루션을 아직 확인하지 않았으므로 다시 필요할 때가 있습니다. – NaturalBornCamper

-1

그냥 INT에 구문 분석 할 필요가 target_id 기억한다. 응답 [ "to"]는 문자열로 반환됩니다.

1

페이 스북 벽에 게시하려면 다음을 사용하십시오.

전화 아래

<a href="#" onclick="publishWallPost()">Post to Wall image/text?</a> 


//facebook: post to wall 
function publishWallPost() { 

     FB.ui({ 
      method: 'feed', 
      name: 'Your App Name', 
      caption: 'Caption Text', 
      description: 'Your description text', 
      link: 'https://www.facebook.com/link/link.link', 
      picture: fbImg 
     }, 
     function (response) { 
      console.log('publishStory response: ', response); 
     }); 
     return false; 
} 


window.fbAsyncInit = function() { 
     FB.init({ 
     appId: 'Your App ID', 
     status: true, 
     cookie: true, 
     xfbml: true 
     }); 
}; 

(function() { 
     var e = document.createElement('script'); 
     e.async = true; 
     e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
     document.getElementById('fb-root').appendChild(e); 
}());