Using the Facebook 2.0 plugin

4

Index

Stats

12,296 visits, 27,593 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 3 Aug, 2014. Last updated 19 Feb, 2019

Fetch Friends Plugin

A plugin to fetch a list of the users friends that have installed your application and a list of friends that have not installed you application. Information returned is the friends full name, app userID, and the url for the profile picture.

Usage

1: In the Construct 2 window right click your mouse and select "Insert new object"

2: Select "FB Friends" to add it to your application. If for whatever reason, you need to perform this action multiple times at once you can add multiple copies of this object.

3: Now let's fetch some user information. Go into the event sheet and add a trigger once along with a While logged in(condition available in the base login plugin).

4: Let's fetch some non game friends. Please add the action "Fetch non-app friends". UserID can be "me" for the current user or set to a friends app userID. Access token can be pulled from the base login plugin as an expression.

5: Now watch the on success and on failure triggers. If a success has triggered you can access the username, picture url, and userID for the non app friend. All expressions have a numerical expression attached that represents where in the friends array you want to access. For example FBFriends.Game_Name(1) will fetch the name for the second friend in the array.

If an on failure fires, then your access token is probably not valid, you triggered the event before Facebook loaded, or the Facebook servers are having issues.

  • 0 Comments

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