Я пытаюсь автоматически получить пользователя изображение профиля при проверке подлинности их FacebookПолучение Facebook Изображение После проверки подлинности
addFacebookInformationToProfile() {
if (Meteor.isServer) {
// This will only merge in information the first time, then ignore it once the flag is true
const user = Meteor.user();
let username = slugify(user.services.facebook.name, '');
let i = 1;
while (Meteor.users.findOne({username})) {
username = slugify(user.services.facebook.name, '') + '' + i;
i++;
}
Meteor.users.update({ _id: Meteor.userId(), 'profile.facebook': { $ne:true }}, {
$set: {
'profile.email': user.services.facebook.email,
'profile.name': user.services.facebook.name,
'username': username,
'profile.gender': user.services.facebook.gender,
'profile.facebook': true
}
});
}
}
То, что я пытался находится под
'profile.gender'
линии я положил
'profile.picture': "http://graph.facebook.com/" + user.services.facebook.id + "/picture/?type=large",
При выполнении этой строки изображение выглядит следующим образом: https://www.dropbox.com/s/j4nzmhad4pf6dqb/Screenshot%202016-05-13%2015.53.25.png?dl=0
У меня также есть пытался 'profile.picture': user.services.facebook.picture,
И напрасно, что может показать, имеют место после того, как 'profile.picture':
Это то, что я при вводе этого кода: [Console Выход] (https://www.dropbox.com/s/w46b00vcss5yhjz/Screenshot%202016-05-13%2016.22.02.png?dl=0) [Что изображает изображение] (https: //www.dropbox. com/s/5igkc3xdkp8cllq/Скриншот% 202016-05-13% 2016.22.29.png? dl = 0) – user3421197
ну ваш скриншот показывает, что вы не вызываете URL-адрес Facebook, а некоторые другие перед ним. – MrE
Я скопировал код здесь [Код] (https://www.dropbox.com/s/3k50nbk1636w98t/Screenshot%202016-05-13%2016.24.15.png?dl=0) – user3421197