1

나는 며칠 동안이 작업을 해왔으며 무엇이 빠졌는 지 찾을 수 없습니다. 누구라도 조언을하나요?내 Facebook 앱이 초대 요청을 보내지 않는 이유는 무엇입니까?

뭔가 빠져있는 것처럼 보이지만 그게 뭔지 전혀 모르겠습니다.
오류가 나타나지 않을 것입니다. 공유 버튼이 작동하여 (자신의 벽에 공유하기 위해) 초대장이 아무 것도하지 않는 것처럼 보입니다.

나는 내 appid를 X로 바꿨다.

<html> 
<head> 
    <title>App Name</title> 
</head> 
<body> 
    <div id="fb-root"></div> 
    <script> 
     var publish = { 
      method: 'stream.publish', 
      display: 'popup', // force popup mode 
      attachment: { 
       name: 'Connect', 
       caption: 'The Facebook Connect JavaScript SDK', 
       description: (
        'A small JavaScript library that allows you to harness ' + 
        'the power of Facebook, bringing the user\'s identity, ' + 
        'social graph and distribution power to your site.' 
       ), 
       href: 'http://app-address.com/' 
      } 
     }; 
     function publish1() { 
      FB.ui(publish);//, Log.info.bind('stream.publish callback')); 
     } 
    </script> 
    <button class="btn" id="send-to-many">Send to Many</button> 

    <button onclick="publish1()">Click</button> 
</body> 

<script> 
    window.fbAsyncInit = function() { 
     console.log('Initing facebook...'); 
     FB.init({ 
      appId: 'xxxxxxxxxxxxxxx', 
      status: true, 
      frictionlessRequests: true, 
      cookie: true, 
      xfbml: true 
     }); 
     console.log('... done'); 
    }; 
    (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); 
    }()); 

    document.getElementById('send-to-many').onclick = function() { 
     FB.ui({ 
      method: 'apprequests', 
      message: 'This is a test of the App-Name invite.' 
      }, requestCallback); 
      function requestCallback(response) 
{ 
if(response && response.request_ids) { 
    // Here, requests have been sent, facebook gives you the ids of all requests 
    //console.log(response); 
    location.href='home'; 
} else { 
    // No requests sent, you can do what you want (like...nothing, and stay on the page). 
} 
} 
} 
</script> 
</html> 
+0

애플리케이션에 캔버스 URL이 설정되어 있습니까? – Lix

+1

이 버그는 모든 앱에서 발생합니다. 제발, 다른 '생일'응용 프로그램을 만들지 마십시오. –

+0

** 생일 ** 앱이 아니지만 통찰력에 감사드립니다. –

답변

0

코드가 잘 보입니다. Facebook 앱 설정에 오류가 있어야합니다. 초대 기능의 경우 '캔버스 URL'& '보안 캔버스 URL'을 페이스 북 앱 설정에 지정해야합니다. 아래 코드를 사용해 볼 수도 있습니다. 이것은 구현할 수있는 매우 간단한 코드입니다.

<script src="http://connect.facebook.net/en_US/all.js"></script> 
<script> 
FB.init({ 
appId:'APP_ID', 
cookie:true, 
status:true, 
xfbml:true 
}); 

function FacebookInviteFriends() 
{ 
FB.ui({ 
method: 'apprequests', 
message: 'Your Message diaolog' 
}); 
} 
</script> 


//HTML Code 
<div id="fb-root"></div> 
<a href='#' onclick="FacebookInviteFriends();"> 
Facebook Invite Friends Link 
</a> 

여기 당신은 iframe 대응을 깨는 또 하나 개의 자바 스크립트 코드를 작성해야합니다. 그래서 링크가 페이스 북에서 열리지 않을 것입니다. 또한 홈 페이지 나 웹 사이트의 다른 페이지에서 앱이 리디렉션하도록하려는 동일한 js 코드를 작성해야합니다.

<script type='text/javascript'> 
if (top.location!= self.location) 
{ 
top.location = self.location 
} 
</script> 

더 궁금한 점이 있으시면 언제든지 여기에 답장하십시오.

0

나는 비슷한 문제가있어서 DONE 버튼을 클릭해야한다는 것을 알았습니다. 이것은 양식이고 DONE 단추는 양식을 제출합니다.

관련 문제