Setting events
First, trigger a Facebook login by clicking the button. Remember to add "public_profile" permission when logging in.
After the user has successfully logged in, let's show his/her name by setting the text to "Hello, " & Facebook.FullName
And now, how to show his/her profile picture?
Get profile picture
Use "Load image from URL" action in the sprite when the user has logged in. Type this string: "https://graph.facebook.com/" & Facebook.UserID & "/picture?type=square"
So how does it work? After the user has logged in, the Facebook object will get his/her User Id. You can insert this Id to the URL above and the Sprite object will get the image from that URL. Very easy!
Remember that there are four types of Facebook profile picture:
- square: maximum width and height of 50 pixels.
- small: maximum width of 50 pixels and a maximum height of 150 pixels.
- normal: maximum width of 100 pixels and a maximum height of 300 pixels.
- large: maximum width of 200 pixels and a maximum height of 600 pixels.
This is the end of my tutorial. Thanks for reading ^^