Paste layer Facebook API SDK JS
I'm trying to grab the Facebook cover of the logged in user, but I'm not having success.
FB.login(function(response){
if(response.authResponse){
FB.api('/me', function(fb){
var email = fb.email;
var nasc = fb.birthday;
var nome = fb.name;
var genero = fb.gender;
var local = fb.hometown;
var idUser = fb.id;
FB.api('/'+idUser+'?fields=source', function(resp){
console.log(resp);
return false;
});
I'm doing as it is in the Facebook documentation, but it doesn't work out.
Object {error: Object} error: Object code: 100 message: "(#100) Tried accessing nonexisting field (source) on node type (User)" type: "OAuthException"
I got it. I put cover in the parameter. But it's not in Doc. Or I read wrong.
FB.api('/'+idUser+'/?fields=cover', function(resp){
console.log(resp);
return false;
});
4
Author: Diego Souza, 2015-06-26
1 answers
I got it. I put cover
(cover) in the parameter. But it's not in Doc. Or I read wrong.
FB.api('/'+idUser+'/?fields=cover', function(resp){
console.log(resp);
return false;
});
2
Author: Diego Souza, 2015-07-29 18:51:06