I\'m trying to get the authenticated Facebook user\'s profile picture, to use within a Meteor application. I\'ve tried the following
Meteor.publish(\"facebo
if you want to get picture for facebook
Accounts.onCreateUser(function(options, user) {
if (typeof(user.services.facebook) != "undefined") {
user.services.facebook.picture = "http://graph.facebook.com/" + user.services.facebook.id + "/picture/?type=large";
}
return user;
});
you can to add this helper function
UI.registerHelper("getImageUser", function (userId) {
var user= Meteor.users.findOne(userId);
if (user.services)
{
if (user.services.facebook)
return user.services.facebook.picture;
if (user.services.twitter)
return user.services.twitter.profile_image_url;
if (user.services.google)
return user.services.google.picture;
}
else
{
return "images/withOutPhoto.png";
}
});
in your html