Using the Facebook 2.0 plugin

4

Index

Stats

12,530 visits, 27,963 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

Scores

Utilize the Facebook platform to save and fetch scores for application users.

Usage

Plugin requires the "publish_actions" permission.

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

2: Select "Facebook Scores" 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: Lets see if a user has a saved score already. Go into the event sheet and add a trigger once along with a While logged in(condition available in the base login plugin).

4: Have an action "Fetch user score". UserID can be "me" for the current user or set to a friends app userID who has granted the publish_actions permission. Access token and AppID can be pulled from the base login plugin as expressions.

5: Now have an on success and on fail trigger conditions. If the on fail trigger fires you can be fairly certain that the publish_action permission was not granted or there was no score saved as of yet. If the on success triggers then look in the userscore expression for the users saved score.

6: Now lets save a score. Go into the event sheet and add a trigger once along with a While logged in(condition available in the base login plugin).

7: Have an action "Set user score". Access token can be pulled from the base login plugin as expressions. Score is the numerical score to save.

8: Now have an on success and on fail trigger conditions. If the on fail trigger fires you can be fairly certain that the publish_action permission was not granted. If the on success triggers then continue on as normal.

  • 0 Comments

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