Load your Facebook profile picture in a Sprite object

3

Index

Stats

6,605 visits, 15,387 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 30 Mar, 2016. Last updated 19 Feb, 2019

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 ^^

  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!