ngx-facebook icon indicating copy to clipboard operation
ngx-facebook copied to clipboard

fb.api using picture edge

Open tvl83 opened this issue 6 years ago • 0 comments

I am trying to retrieve the profile pictures of friends using the app and I am getting a not valid json response error. I can do the same exact call via postmates and get a proper response and on the graph API explorer on facebook and I see the JSON response there, even with the access_token I get on my site.

It seems that the response to the picture using ngx-facebook has the response coming in the headers instead of a json response.

I am able to use fetch and get it fine. It doesnt have a data object in json there's just a url key in the response that I can use.

fetch(`https://graph.facebook.com/v2.12/${this.fbUserId}/picture?access_token=${this.accessToken}&format=json&height=150&width=150`)
      .then(response => {
         console.log(response.url);
      });

For anyone else wanting to use it this is how I did it. You can change the height and width in the url (or parse the url and change it after the fact) and it will return the size asked for.

tvl83 avatar Apr 04 '18 15:04 tvl83