I am trying to get the user gender and birth date through the following:
FB.api('/me', function(response) {
var query = FB.Data.query('select birthday, gender from user where owner={0}',
response.id);
query.wait(function(rows) {
console.log(rows[0].birthday);
console.log(rows[0].gender);
alert(rows[0].birthday);
alert(rows[0].gender);
});
});
However, I see nothing on the console and there is no alert. Why is this?
If you want the birthday and gender of an authenticated user (/me) you can just access the User Object like this:
If you want the birthday and gender to come from the user table you can't use the "gender" field because it doesn't exist. Use "sex" instead.
You received no response because you were trying to access a field that doesn't exist.