Comments (5)
I got it. In case it is useful, I just created a FacebookLoginOptions
variable with scope
attribute with email
value, when calling the login function. Then in the API call for getting user data I added the email in the fields list In the reference documentation I left before it is explained, but not for Typescript.
This is the example code:
let loginOption: FacebookLoginOptions = {
scope: 'email'
};
this.facebookService.login(loginOptions).then(
(response: FacebookLoginResponse) => {
// ...
this.getFacebookData();
},
(error: any) => console.error(error)
);
// Facebook API call for getting user data
public getFacebookData() {
this.facebookService.api('/me?fields=id,name,first_name,gender,email').then(
(response: any) => {
console.log('Email: ', response.email);
},
(error: any) => console.error(error)
);
}
from ngx-facebook.
I cannot get the email address. And I am using code very similar to the above. I can get other values, but for some reason email is not apart of the returned json object
options: LoginOptions = {
scope: 'email,public_profile'
};
...
facebooklogin(){
this.fb.login(this.options)
.then((response: LoginResponse) => {
this.showData(response)
})
.catch(e => console.error('Error logging in'));
}
showData(data){
console.log(data);
this.fb.api('/me?fields=email,name')
.then((res:any)=>console.log(res))
.catch(e=> console.log(e));
}
returns
{name: "", id: ""}
but not email
from ngx-facebook.
super wierd...For some reason it has something to do with my developer account I think. I have a primary email address registered with the Facebook profile that I am using, but for some reason the email is not retrieved. I decided to create another Facebook account, I then added this account to the developer account, and i can get the email address from that account....Anyway if somebody has this problem, and you're doing the above steps, try getting the email from a different Facebook account, which might involve creating/adding a new developer to your developer account.
from ngx-facebook.
Hello ,
I am not able to get email address when I use ths ngx-facebook in my component. Please see my code.
facebookLogin(){
const options: LoginOptions = {
return_scopes: true,
enable_profile_selector: true
};
this.fb.login(options)
.then((response: LoginResponse) => {
this.fbData = response.authResponse.accessToken;
console.log(this.fbData);
this.me(this.fbData);
})
.catch(e => console.error('Error logging in'));
}
me(authResponse){
let self = this;
this.fb.api('/me?fields=id,name,email,first_name,last_name,gender', 'get', {access_token:authResponse})
.then(res => {
console.log("user Results", res);
})
.catch(e => console.log(e));
}
I got all other parameter like name, id first_name but I am not getting email address. Can anybody help me about this headache issue??
from ngx-facebook.
I am having the same problem.
Facebook Graph Explorer throws some debug message
The field 'email' is only accessible on the User object after the user grants the 'email' permission.
I have scope email and other addons added, but the user is asked only about his name and profile picture. It happens on every version. Refreshing token in explorer solves it, but no idea whats wrong inside the SDK.
It only happens when app is added to homescreen. PWA
from ngx-facebook.
Related Issues (20)
- "Unexpected token import" error with Angular Universal HOT 5
- fb-page does not display inside *ngIf or ng-template HOT 1
- How to use fb-video in lazy loaded modules? HOT 4
- Add support for new Messenger Customer Chat SDK HOT 5
- Maintenance?
- How to make fb-video mobile responsive ? HOT 2
- Facebook Like button not showing on browser
- How to pause particular fb-video in for loop ?
- I got an issue with Angular 7 with the Frameworks: Inonic 4/Cordova
- Modifying the attributes after the component is loaded does not reload the component
- Prod mod does not work load services
- Post to user wall
- Not compiled after Angular 9.0.0-next.11 HOT 16
- Posts not rendered HOT 4
- fb_Page NOT WORKING with URL as variable HOT 3
- Clicking on cancel icon instead of continue with ... in dialog login page automatically login in
- wrapper not working HOT 2
- not able to focus on current facebook login windows popup
- share dialog close
- Add support for Angular 16 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-facebook.