So I want to simply get likes/followers count of my fanpage from the facebook. And I want to do it with JS and display this on my website. And here problems begin... Do I really need access token for such a simple thing? Page followers count is visible to anyone on facebook without even logging in but when I want to use:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'myappid',
autoLogAppEvents : true,
xfbml : true,
version : 'v3.0'
});
FB.api(
'/myfanpage',
'GET',
{"fields":"fan_count"},
function(response) {
console.log(response);
}
);
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
all I got is:
message: '(#200) Provide valid app ID', type: 'OAuthException', code: 200
but why? Do I really need to create account on developers.facebook.com, get the app ID, get the token, set the permissions just to get something that is visible anyway to anyone? Makes no sense. Also this error is ridiculous because the appId is valid.