hello.js
hello.js copied to clipboard
Facebook email is not returning in me api
I've tried so many different ways
e.g.
var facebook = hello('facebook');
facebook.login({
scope: 'email,user_friend',
force: true
}).then(function() {
return facebook.api('me/permissions');
}).then(function(r) {
if (r.data.filter(function(item) {
return item.permission === 'email' && item.status !== 'granted'
}).length) {
throw new Error('missing permissions');
}
else {
return facebook.api('me');
}
}).then(successShowEmail, errorShowLoginButton);
hello.login(network, { scope: 'email' })
But I am not able to receive email from hello.js
Perhaps its a app level permission thing. Do you get it when using the demo at https://adodson.com/hello.js/?
Hello
I have the same issue with the hello.js on a new domain and app. On a older app and domain it is working as expected...
Older App ( & old domain ):
array (
'id' => '...',
'birthday' => '...',
'email' => '...',
'first_name' => '...',
'gender' => '...',
'last_name' => '...',
'link' => '...',
'locale' => '...',
'name' => '...',
'timezone' => 1,
'updated_time' => '...',
'verified' => true,
'picture' => '...',
'thumbnail' => '...',
)
New App & Hello.js page ( & new domain ):
array (
'name' => '...',
'id' => '...',
'picture' => '...',
'thumbnail' => '...',
)
Can't figure this out...
Perhaps define the fields property?
hello('facebook').api('me', {fields: 'email,name,id'}).then(successHandler)
That worked ( using me?fields=xxxx ). But on the older app ( same api version ) worked without requesting fields -.-
Facebook giving special treatment to older apps is less likely the reason the older app is working -.- But that is just my rant...
Thank you for the time @MrSwitch
Same issue here now. My old app from 2016 works fine on getting an email from facebook and google, now I can't get it anymore. Made the suggested trick by MrSwitch, but no success. Any help?
hello.on('auth.login', function(r) {
// Get Profile
hello( r.network ).api( '/me', {fields: 'email,name,id'} ).then( function(p) {
console.log("got in: " + JSON.stringify(p, true, 2));
user_name = p.name;
user_email = p.email;
user_profile_pic = p.thumbnail;
user_network = r.network;
user_kind = p.kind;
user_gender = p.gender;
user_url = p.url;
user_last_name = p.last_name;
user_first_name = p.first_name;
user_id = p.id;
user_display_name = p.displayName;
if (typeof(chrome) === 'object') {
img_xhr(label.getElementsByTagName('img')[0], p.thumbnail);
}
});
});
// Intiate App credentials
hello.init({
google : CLIENT_IDS_ALL.google,
facebook : CLIENT_IDS_ALL.facebook
},{
scope : ['friends','email'],
force : true,
redirect_uri: REDIRECT_URI,
oauth_proxy: OAUTH_PROXY_URL
});
only with scope: ['email'] in hello.init () is enough, you can omit the fields in
....api ('me', {fields: 'email, name, id'})...
it has worked for me (Google), I have not tried for facebook