0

I have an Angular2 app which is using a third party component for Facebook authentication. The component is quite good but I am having problems adding a permission request to the authentication url.

Has anyone used the component named ng2-facebook-sdk? If so does anyone know how I would go about adding a parameter to the authentication url as described in this question...

Facebook Graph API, how to get users email?

Currently my code looks like this...

ngOnInit(): void {
    let fbParams: FacebookInitParams = {
        appId: 'XXXXXXXXXXXXX',
        xfbml: true,
        version: 'v2.6'
    };
    this.fb.init(fbParams);

    this.fb.login().then(...
}

As per the above post I want to...

"You can do this if you are using Facebook connect by passing scope=email in the get string of your call to the Auth Dialog."

Does anyone have any ideas?

Community
  • 1
  • 1
Ben Cameron
  • 4,335
  • 6
  • 51
  • 77

1 Answers1

1

I figured it out myself, you can pass a param into the login call...

let options: FacebookLoginOptions = {
        scope: 'email'
    }

    this.fb.login(options).then(
Ben Cameron
  • 4,335
  • 6
  • 51
  • 77