请问各位大大
我目前想在网页上取得使用者是否于指定的粉丝团按过赞
但我在程式执行测试时发现,只有开发者(fb developer)的帐号可以取得资料
而使用其它FB帐号来测试则无法取得user_likes的资料(UID 可取得)
请求各位大大能帮忙解答,感谢
以下是我的code
<script src="js/jquery-1.11.0.min.js"></script>
<button id="fb-login" onclick="fl01()">Login to Facebook</button>
<div id="fb-root"></div>
<div id="userdata"></div>
<script src="http://connect.facebook.net/zh_TW/all.js"></script>
<script>
FB.init({
appId: "xxxxxxxxxxxxxxx",
status: true,
cookie: true,
xfbml: true,
oauth: true
});
FB.getLoginStatus(function(response) {
if (response.status === "connected") {
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
} else if (response.status === "not_authorized") {
} else {
}
});
function fl01() {
//initiate OAuth Login
FB.login(function(response) {
if (response.authResponse) {
FB.api("/" + response.authResponse.userID + "/likes",
function(details) {
document.getElementById("userdata").innerHTML=JSON.stringify(details, null,
'\t');
$("#fb-login").attr("style", "display:none;");
alert(response.authResponse.userID);
});
}
}, {
scope: "user_likes"
});
};
</script>