1
I’m already able to login with facebook but I don’t get the photo of the person, how to do this?
I saw some things like ''https://graph.facebook.com/ID_user/picture
But how can I use it?
1
I’m already able to login with facebook but I don’t get the photo of the person, how to do this?
I saw some things like ''https://graph.facebook.com/ID_user/picture
But how can I use it?
0
I did it this way:
FB.getLoginStatus(function(response){
if(response.status == 'connected') {
FB.ui(obj, callback);
}
else {
FB.login(function(response){
if(response.status == 'connected') {
//Depois do login chamo o callback
FB.ui(obj, callback);
}
});
}
});
//Função do callback
function callback(response) {
if(response.error_code == 4201)
{
}
else
{
//Como no post_id retornado vem a {id}_{post_id}, eu dou um split e pego a ID.
var ids = response['post_id'].split('_');
//Como eu usei o angular, fiz os comandos abaixo, mas se quiser apenas a id -> ids[0];
var appElement = document.querySelector('[ng-controller=FbController]');
var $scope = angular.element(appElement).scope();
$scope.$apply(function() {
$scope.addJson(ids[0]);
});
}
}
To get the photo I used the API http://graph.facebook.com/v2.6/{{id}}/picture
Browser other questions tagged php javascript
You are not signed in. Login or sign up in order to post.
this he a json file he so vc parse with jquery or php to get the information q need
– Jasar Orion
Avoid posting links to questions, post the code of what you have tried, or the information that is returned by a web service link for example. If you have questions on how to prepare your question, read this: http://answall.com/help/how-to-ask
– Celso Marigo Jr