I am a newbie in coding. When I called the below function to post on my wall. I always encouunter error occured alert box. I have search the web for few days still cannot find the result and the fix. The facebook documentation is really bad. Please help. I could call fb.ui, or fb.getloginstatus with no problem. But just have problem of calling the fb.api.
function postToWall() {
var body = 'Reading JS SDK documentation';
FB.api('/me/feed', 'post', { message: body }, function(response) {
if (!response || response.error) {
// alert('Error occured');
} else {
// alert('Post ID: ' + response.id);
}
});
FB.api('/me', function(response) {
// console.log(response);
});
}
The error message is-
An active access token must be used to query information about the current user.
response.error.messageand write here. - Sahil Mittal