請問各位大大
我目前想在網頁上取得使用者是否於指定的粉絲團按過讚
但我在程式執行測試時發現,只有開發者(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>