2012-12-13 9 views
2

제공 한 Js 파일을 사용하여 Facebook 응용 프로그램을 작성하려고합니다.(# 200) 사용자가이 작업을 수행하도록 응용 프로그램을 승인하지 않았습니다.

내 앱에 사용자 등록을 할 수 있지만 자신의 벽에 피드를 게시해야합니다. 또한 사용자 승인을위한 사전 확인 메시지를 원하지 않으므로 사용자는 자신의 계정에만 로그인해야합니다.). 사용자는 다음이 작업

을 수행하는 응용 프로그램을 승인하지 않은 내가 (# 200)를 얻을 :

<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> 

FB.init({ appId: '<%: Facebook.FacebookApplication.Current.AppId %>', status: true, cookie: true, xfbml: true }); 
    var userName; 


    FB.login(function (response) { 
     //alert('1'); 
     if (response.authResponse) { 
      var access_token = FB.getAuthResponse()['accessToken']; 
      //alert('Access Token = ' + access_token); 
      FB.api('/me', function (response) { 
       alert('Good to see you, ' + response.name + '.'); 
       userName = response.name; 
       document.getElementById('btnPostFeed').style.display = 'block'; 

      }); 
     } else { 
      document.getElementById('btnPostFeed').style.display = 'none'; 
      //console.log('User cancelled login or did not fully authorize.'); 
     } 
    }, { scope: '' });  

function SubmitPost(msg) { 
try { 
    if (userName != null || typeof userName != 'undefined') { 
     var wallPost = { 
      message: msg + " By : " + userName, 
      picture: '', 
      link: '', 
      name: 'test app posted in your wall', 
      caption: '', 
      description: ('Test description') 
     }; 
     FB.api('/me/feed', 'post', wallPost, function (response) { 
      if (!response || response.error) { 
       /*action*/ 
       alert('Message could not be Posted.'); 
       alert(response.error.message); 
      } else { 
       /*action*/ 
       alert('Message Posted successfully.'); 
      } 
     }); 
    } 
    else { 
     alert('Please wait while User Info is Loaded..'); 
    } 
} 
catch (err) { alert('SubmitPost: ' + err); } 

내 주요 문제는 다음과 같습니다

다음

는 코드입니다 앱 등록을위한 스크린 샷 : enter image description here

어떻게해야합니까? 당신은 당신이 그것을 승인하지 않습니다 올바른 권한을 요청하지 않는 경우

+1

앱에서 '범위'란 무엇을 요청하고 있습니까? [Permission] (https://developers.facebook.com/docs/authentication/permissions/) 설명서를 읽었습니까? – Igy

답변

1

귀하의 범위는이 라인

}, { scope: '' });

완전히 비어 있습니다.

하지만 벽에 피드를 게시해야합니다 (또한 사용자 승인을위한 사전 확인 메시지를 원하지 않음, 사용자는 자신의 계정에만 로그인해야 함).

사용자가 벽에 게시하도록 승인해야합니다. 그들이 로그인 만하면 벽에 게시하는 것을 제외한 가장 기본적인 권한을 부여합니다.

관련 문제