如何通过Graph API和Javascript SDK从iframe应用程序检查喜欢的风扇页面
这是我的代码,只有在应用开发者帐户上才能正常工作。我的错在哪里如何通过Graph API和Javascript SDK从iframe应用程序检查喜欢的风扇页面,javascript,facebook,facebook-graph-api,facebook-like,Javascript,Facebook,Facebook Graph Api,Facebook Like,这是我的代码,只有在应用开发者帐户上才能正常工作。我的错在哪里 window.fbAsyncInit = function() { var APP_ID = 'XXXXX'; var PAGE_ID = 'XXXXX'; FB.init({ appId : APP_ID, status : true, // check login status cookie : true, // enable cookies to allow the server to acc
window.fbAsyncInit = function() {
var APP_ID = 'XXXXX';
var PAGE_ID = 'XXXXX';
FB.init({
appId : APP_ID,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
});
FB.api('/me/likes/' + PAGE_ID, function(response) {
t = $.toJSON(response);
alert(t);
});
}
结果
开发者帐户:
{"data":[{"name":"111222333","category":"Small business","id":"281428705206834","created_time":"2011-09-02T14:14:37+0000"}]}
{"error":{"type":"OAuthException","message":"An active access token must be used to query information about the current user."}}
非开发商账户:
{"data":[{"name":"111222333","category":"Small business","id":"281428705206834","created_time":"2011-09-02T14:14:37+0000"}]}
{"error":{"type":"OAuthException","message":"An active access token must be used to query information about the current user."}}
这可能与页面设置有关。如果页面设置为不可见(如仅对该页面的管理员可见),则可能是导致该错误的原因
您是否已将页面设置为可供所有人使用?这可能与页面设置有关。如果页面设置为不可见(如仅对该页面的管理员可见),则可能是导致该错误的原因
您是否已将您的页面设置为可供所有人使用?要查看用户喜欢的graph api,您需要获得相应的权限。用户喜欢什么 见:
为了查看用户喜欢的graph api,您将需要这样做的权限。用户喜欢什么 见:
处于沙盒模式的应用程序是否在应用程序设置内?处于沙盒模式的应用程序是否在应用程序设置内?