davidwittenbrink/facebook-login

Function to get cover-picture from user

Closed this issue ยท 3 comments

Hi, @davidwittenbrink Great web component ๐Ÿ‘
I would like a function so I can get the cover picture from the user as discusted here. http://stackoverflow.com/questions/12434261/get-cover-photo-using-facebook-api

and also would sugest to add some options for the login button like the size
I added this line to the code and you can set the size there, a property for that would be great!
fbButton.setAttribute("data-size","large");

I added the button-size attribute and made a pull request yesterday:
#10

I'll look into the api calls required for cover photos, this might just need to be passed in as a variable in the scope or params

I just merged #10 which includes the button-size attribute so you should be good to go.
Concerning the cover photo: I'm not sure it's a good a idea to build separate functions for api features since that could lead to a very complicated component.
You should be able to get the cover photo using e.g. /me?fields=cover though. Let me know if you run into any issues with that!

This issue should be closed because it is possible and #10 was merged.

For the other part about the cover photo, here's an example:

<facebook-login appID="55555" button-size="xlarge" logout-link="true" graph-url="me?fields=cover,first_name,last_name,email,picture.type(normal)" scope="public_profile email" graph-response="{{user}}" auto-api-call></facebook-login>

Then you can use this in your Polymer app with:

<div>[[user.id]]</div>
<div>[[user.accessToken]]</div>
<div>[[user.first_name]]</div>
<div>[[user.last_name]]</div>
<div>[[user.email]]</div>
<img src="[[user.picture.data.url]]" />
<img src="[[user.cover.source]]" />

Good luck with your application.