Using the Facebook 2.0 plugin

4

Index

Stats

12,294 visits, 27,591 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

Facebook Photo Upload

This plugin utilizes javascript to upload the Construct 2 canvas snapshot to the users Facebook profile. For security reasons, Facebook restricts your ability to upload pictures to a specific application image folder. So you cannot for example update the users profile picture on them.

Usage

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

2: Select "Facebook photo upload" 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: We have already created a snapshot I'm assuming, see the Scirra manual for instructions on creating a png snapshot if you do not know how to perform this step.

4: Create an on snapshot complete trigger.

5: In the Facebook base plugin, add the "While Logged In" condition.

6: Add the Upload PNG Image action.

7: Data will be canvassnapshot

8: Message is a user defined caption for the image. Only a user may enter this information. Do not auto generate.

9: Access Token will be the access_token expression from the FacebookControl plugin.

10: UserID is set to "me" by default. "me" is the user logged into your account. I believe it may be possible to upload pictures to a friends account however if you have a current access token and the friends application user Id. This action requires the user has granted the publish actions permission(See the Facebook Base plugin)

11: Included are on success and on fail trigger conditions so you can resume normal play once the action has completed.

12: An expression is also included that returns the Facebook ID of the newly uploaded picture.

  • 0 Comments

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