2011-01-31 1 views
1

Facebook FBML 응용 프로그램에서 Facebook publishStream 메소드를 사용하고 있습니다. 일부 개발자는 저보다 먼저 작업했습니다. 나는이Facebook 게시 스트림 URL 설정

Facebook.streamPublish('Publish Shirt Tale. <?php echo $canvasURL.'?req=tale-details&tale_id='.$tale_id?>', attachment); 

처럼에게 어떤 것을 사용하고 그러나 공유 이미지 아래 또 다른 URL이 더 많은 정보를 원하시면 이미지 아래 참조 enter image description here

그래서 그렇게 둘러싸 링크는이 이미지로 다른 페이지 쪽을 가리키며 앱의 첫 번째 페이지로 이동합니다. 현재 다음과 같은 페이지로 이동합니다. http://apps.facebook.com/apps/application.php?id=xxxxxxxxxxxxx

그래서 어디에서 URL을 지정할 수 있습니까?

미리 감사드립니다.

+0

체크 어떤 것을 $ canvasURL 광고 $의 tale_id의 변수 : http://www.yoursite.com/game1.php

  • 는 FBML 응용 프로그램이 같을 것이다 그 안에있는 값들. 다른 응용 프로그램을 가리킬 수도 있습니다. 그냥 그 변수를 반향하고 그들의 값을 참조하십시오 –

  • +0

    괜찮아요하지만 일부 설정에 어떤 문제가 있다고 생각하지만, 내가 이것을 설정할 수있는 곳에서 이해가 안 돼 – Hafiz

    +0

    '첨부 파일'에 무엇이 있습니까? – Bartek

    답변

    3

    내가 look here에 조언을하고, 시도하고이 방법으로 대화 상자를 만들 것 deprecating all FBML apps soon입니다. 내가 현재 사용하고있는 스크립트를 제공 할 수 있습니다. 여기서 당신이 돌린 링크가 내 앱의 홈페이지로 연결됩니다. 메모를 작성해야합니다 .- 내 앱은 Iframe 앱입니다.

    <script type="text/javascript"> 
        FB.ui(
        { 
        method: 'stream.publish', 
        attachment: { 
         name: 'name', 
         caption: 'caption', 
         source: 'picture.jpg', 
         picture: 'picture.jpg', 
         description: 'description', 
         href: 'http://apps.facebook.com/appname' 
        }, 
        action_links: [ 
         { text: 'name', href: 'http://apps.facebook.com/appname' } 
        ] 
        }, 
        function(response) { 
        if (response && response.post_id) { 
         alert('Post was published.'); 
        } else { 
         alert('Post was not published.'); 
        } 
        } 
    ); 
        </script> 
    

    당신은 그러나 당신이 FBML 양식에 응용 프로그램을 유지하려는 경우,이 코드를 시도 :

    <script type="text/javascript"> 
        FB.ui(
        { 
        method: 'stream.publish', 
        attachment: { 
         name: 'name', 
         caption: 'caption', 
         source: 'picture.jpg', 
         picture: 'picture.jpg', 
         description: 'description', 
         href: 'http://apps.facebook.com/appname/index.php' 
        }, 
        action_links: [ 
         { text: 'name', href: 'http://apps.facebook.com/appname/index.php' } 
        ] 
        }, 
        function(response) { 
        if (response && response.post_id) { 
         alert('Post was published.'); 
        } else { 
         alert('Post was not published.'); 
        } 
        } 
    ); 
        </script> 
    

    을 당신은 IFRAME과 FBML 애플 리케이션 사이의 차이를 이해할 필요가 : iframe이 애플 리케이션은을하는 동안 사용자가 항상 동일한 페이지에 머무르고 Iframe의 내용 만 변경되면 FBML 응용 프로그램은 실제로 사용자를 페이지에서 페이지로 이동시킵니다. FBML 앱에서 링크를 지정할 때 http://www.yoursite.com/page 링크 대신 http://apps.facebook.com/appname/page 링크를 사용하는 것이 중요합니다.

    예 링크 :

    1. 귀하의 사이트에 링크 : http://apps.facebook.com/appname/game1.php
    1

    ok 하피즈가이 코드를 사용해보십시오. 페이스 북으로 당

     
    FB.ui({ 
        method: 'stream.publish', 
        message:'hello', 
        attachment: { 
         name: title, 
    
         caption: "I'm running!", 
         media: [{ 
         type: 'image', 
         href: 'http://www.yoursite.com/', 
         src: 'http://www.yoursite.com/images/working.jpeg' 
         }] 
        }, 
        action_links: [{ 
         text: 'Get your percentage', 
         href: 'http://www.yoursite/' 
        }], 
        user_message_prompt: 'Tell your friends about Get your percentage:' 
        }); 
    
    +1

    Don;하기 전에 JavaScript SDK를 초기화하는 것을 잊지 마십시오. http://developers.facebook.com/docs/reference/javascript/fb.init/ – t0mgs