Mobile Facebook (Legacy)

The Mobile Facebook (Legacy) plugin is specifically designed to implement native Facebook features in the Facebook Android SDK and Facebook iOS SDK in your applications in Android and iOS, for games built in Construct 3 and Construct 2.


Features including calling the graph api, facebook analytics, facebook authentication, facebook profile information, facebook app requests, send and share, facebook server credentials and facebook access token.


The Mobile Facebook (Legacy) plugin supports both Construct 3 editor and Construct 2 editor.


Note: Please migrate and use the new Mobile Facebook plugin which has support for the latest Facebook Android SDK and Facebook iOS SDK. The new plugin includes new features from the latest Facebook SDKs such as Facebook Tracking that replaced the previous Facebook Analytics.



PlayFab API v2.png

Introduction

Step 1.png

The Construct Master Collection supports the full and easy integration of native mobile Android SDKs and iOS SDKs for both Construct 3 and Construct 2.


Please click here to learn more about Mobile.

Features


The Mobile Facebook (Legacy) plugin is specifically designed to implement native Facebook features in the Facebook Android SDK and Facebook iOS SDK in your applications in Android and iOS, for games built in Construct 3 and Construct 2.


Features including calling the graph api, facebook analytics, facebook authentication, facebook profile information, facebook app requests, send and share, facebook server credentials and facebook access token.


Note: Please migrate and use the new Mobile Facebook plugin which has support for the latest Facebook Android SDK and Facebook iOS SDK. The new plugin includes new features from the latest Facebook SDKs such as Facebook Tracking that replaced the previous Facebook Analytics.


Here are some of the native features of the mobile plugin:

  • Facebook integration

  • Facebook Analytics integration

  • Facebook Android SDK

  • Facebook iOS SDK

  • Facebook Connect

  • Graph API Calls

  • App Request

  • Share Dialog

  • Send Dialog

  • Facebook Profile

  • Server Access Token

For more information about native mobile or Android and iOS features, please click here to learn the introductory lessons to Mobile.


Platform Integration


Here are some of the platforms that are natively supported:

  • Android

  • iOS

  • Native Android

  • Native iOS


Build Support


Here are some of the supported build options:


Editor Features


Here are some of the features in the Construct editor:

  • Construct 3

  • Construct 2

 
 

How to use?

It is easy to use the Mobile Facebook plugin, you will only need to follow the steps below.

1. The first step is to add the Mobile Facebook object into the project.


2. To enable logs in the console for mobile debugging, enable the Debug Mode property in the Properties bar.



3. To get the App Id and App Name properties, retrieve them from your Facebook application's dashboard in the Meta for Developers console.

 
 

Documentation

Here are the following official documentation and guides into setting up your Facebook application in the Meta for Developers.


Facebook Developer


There are some few steps required by Meta to properly integrate the Meta (Facebook) Android SDK and Meta (Facebook) iOS SDK.


Android


  • If built for Android, you need to input your application's hash code into your application's configuration from the Meta Developer Console's Facebook application dashboard.

  • For instructions in how to do this, please click the link to visit Meta's official documentation.

  • [Tip]: If you export your application into a debug .apk or release .apk, your application will show an error that its hash code is invalid and unregistered in the Facebook application dashboard in the Meta Developer Console. You can copy the hash code shown in the error with the format similar to the image above, and paste it into the Meta Developer Console, similar to the image above and documentation.


iOS

 

Actions, Conditions & Expressions

Actions

press to zoom

press to zoom
1/1

The following action groups:

  • Facebook Login

  • Retrieve Info

  • Show Dialog

  • Advanced : Graph API

  • Facebook Analytics : Log Event

  • Facebook Analytics

  • Tools

Facebook Login

  • Login - Login to Facebook. This automatically "Gets Status" and update the expressions.

  • Permissions - Example : "public_profile", "email", "user_friends". Separate each permissions with a coma.


  • Logout - Logout of Facebook.



Retrieve Info

  • Get Status - Retrieve the Login Status for the expressions. Overwrites the expressions from login.


Show Dialog

  • Share Dialog - Prompt a Facebook Share Dialog.

  • URL - The Share URL Link.

  • Caption - The Share Caption.

  • Description - The Share Description.

  • Picture - The URL for the picture.

  • HashTag - Example: "#myHashtag". Leave blank if not needed.

  • Name - The Share Name. Leave blank if not needed.

  • Message - The Share Message. Leave blank if not needed.


  • App Request - Prompt a Facebook Game Request Dialog to non-app users.

  • Title - The "Title" for the Game App Request.

  • Message - The "Message" for the Game App Request.

  • Data - The "Data" for the Game App Request.

  • Picture - The URL for the picture. Leave blank if not needed.


  • Send Dialog - Prompt a Facebook Send Dialog.

  • URL - The "URL" for the Send Dialog.

  • Caption - The "Caption" for the Send Dialog.

  • Description - The "Description" for the Send Dialog.

  • Picture - The "Picture" for the Send Dialog.

  • Name - The Share Name. Leave blank if not needed.

  • Message - The Share Message. Leave blank if not needed.


Advanced : Graph API

  • Call Graph API - Allows access to the Facebook Graph API. This API allows for additional permission because, unlike login, the Graph API can accept multiple permissions.

  • Request Path - The Request Path for the Graph API.

  • Permissions - Example : "email", "user_friends". Separate each permissions with a coma.


Facebook Analytics : Log Event

  • Add Log Data Parameter - Add an extra data to log with the event. (This is optional).

  • Key - The "Key" of the Data.

  • Value - The "Value" of the Data.

  • Log Event - Log an Event using Facebook Analytics.

  • Name - The "Name" of the Event.

  • Increment Value - The value to add to all the sum of this event across the application.


Facebook Analytics

  • Log Purchase - Log a Purchase using Facebook Analytics.

  • Value - The "Value" of the Purchase.

  • Currency - The "Currency" of the Purchase. Must be in ISO 4217 currency code. For Example, "USD" or "PHP".


  • Manually Log : Activate App - Usually this is not needed as it is always automated. But just in case, this logs that the App is activated using Facebook Analytics.


Tools

  • Load Access Token - Load the Access Token from the Login Status. This will return the value to the expression "loadAccessToken".

Conditions

The following condition groups:

  • Facebook Login

  • Retrieve Info

  • Facebook Analytics

  • Tools

  • Share Dialog

  • App Request

  • Send Dialog

  • Graph API

press to zoom

press to zoom

press to zoom
1/2

Facebook Login

  • On Login Succeeded - Triggered when "Login" has Succeeded.

  • On Login Failed - Triggered when "Login" has Failed.

  • On Logout Succeeded - Triggered when "Logout" has Succeeded.

  • On Logout Failed - Triggered when "Logout" has Failed.

Retrieve Info

  • On Get Status Succeeded - Triggered when the "Get Login Status" has Succeeded.

  • On Get Status Failed - Triggered when the "Get Login Status" fails.

  • Is Connected - Check if a Facebook Login was already established and connected successfully.


Facebook Analytics

  • On Log Event Succeeded - Triggered when the "Log Event" has Succeeded.

  • On Log Event Failed - Triggered when the "Log Event" has Failed.

  • On Log Purchase Succeeded - Triggered when the "Log Purchase" has Succeeded.

  • On Log Purchase Failed - Triggered when the "Log Purchase" has Failed.

  • On Manual Log Activation - Triggered when the "Manual Log Activation" has Succeeded.

  • On Manual Log Activation Failed - Triggered when the "Manual Log Activation" has Failed.


Tools

  • On Access Token Loaded - Triggered when the "Load Access Token" has finished.

  • On Access Token Load Failed - Triggered when the "Load Access Token" has failed. Happens when not logged in.

Share Dialog

  • On Share Dialog Succeeded - Triggered when the "Share Dialog" has Succeeded.

  • On Share Dialog Failed - Triggered when the "Share Dialog" has Failed.


App Request

  • On App Request Succeeded - Triggered when the "App Request" has Succeeded.

  • On App Request Failed - Triggered when the "App Request" has Failed.


Send Dialog

  • On Send Dialog Succeeded - Triggered when the "Send Dialog" has Succeeded.

  • On Send Dialog Failed - Triggered when the "Send Dialog" has Failed.


Graph API

  • On Graph API Succeeded - Triggered when the "Graph API" has Succeeded.

  • On Graph API Failed - Triggered when the "Graph API" has Failed.

Expressions

press to zoom

press to zoom
1/1

The following expression groups:

  • Tools

  • Graph API

  • Facebook Status

Tools

  • loadAccessToken - Return the "Access Token" from the "Get Access Token" action.

Graph API

  • getGraphAPIData - Get the Graph API Data Object.



Facebook Status

  • getAccessToken - Get the Access Token from "Login" or "Get Status".

  • getExpiresIn - Get the Expiration Time. Indicates the UNIX time when the token expires and needs to be renewed.

  • getUserID - Get the Facebook User ID. The ID of the person using the app.

  • getStatus - Get the Facebook Connection Status. Either "connected", "not_authorized" or "unknown".

Object   Properties

Plugin Properties

press to zoom

press to zoom
1/1

The following property groups:

  • Universal

  • Facebook Credentials

Universal - General Plugin Properties.

  • Debug Mode - If "Enabled", the runtime will log errors. This should be "Disabled" on production.

  • Enabled

  • Disabled


Facebook Credentials - Input here the Facebook Credentials. This is important, otherwise you'll receive a build failure.

  • App ID - The Facebook Application ID found at the Facebook Developers : Console.

  • App Name - The Facebook Application Name found at the Facebook Developers : Console.

  • SDK Version - The Facebook SDK Version to be used. The default value changes on every update. Default: "5.0.0".


 
 

Showcase

The Mobile Facebook (Legacy) is a plugin that integrates the native mobile Facebook Android SDK and Facebook iOS SDK into an application made in Construct 3 or Construct 2. It allows you to implement Facebook features into your game projects.



 

Game Projects 

Instructions Kit

Construct 3 Project
Construct 3 Project

press to zoom
Construct 2 Project
Construct 2 Project

press to zoom
Construct 3 Project
Construct 3 Project

press to zoom
1/2

Specifications

  • Instructions - The game project contains instructions and steps on how to use the addon and its features.

  • Action, Conditions and Expressions - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks on the recommended ways of using the addon.

Supporters

Only