Mobile Facebook

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


The Mobile Facebook plugin covers all the essential features in the Meta Android SDK and Meta iOS SDK, including Facebook login, profile, game requests, share, send, tracking, events, pixel events, hybrid events, app links, url schemes, advertiser id collection, advertiser tracking, purchase logging, application id, application name, permissions, data access, user data, data procressing, Graph API, etc.


The Mobile Facebook plugin supports both Construct 3 and Construct 2, with both runtimes written from scratch for optimal integration.

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 plugin is specifically designed to implement native Facebook (Meta) features in the Meta Android SDK and Meta iOS SDK in your applications on Android and iOS, for games built in Construct 3 and Construct 2.


The Mobile Facebook plugin covers all the essential features in the Meta Android SDK and Meta iOS SDK, including Facebook login, profile, game requests, share, send, tracking, events, pixel events, hybrid events, app links, url schemes, advertiser id collection, advertiser tracking, purchase logging, application id, application name, permissions, data access, user data, data procressing, Graph API, etc. The Mobile Facebook plugin also supports the Facebook Audience Network's advertiser tracking compliance features, with both the Meta Audience Network Android SDK and Meta Audience Network iOS SDK.


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

  • Facebook integration

  • Facebook Tracking integration

  • Facebook Audience Network advertiser tracking.

  • Facebook Android SDK

  • Meta Android SDK

  • Facebook iOS SDK

  • Meta iOS SDK

  • Facebook Connect

  • Facebook Authentication

  • Login or logout

  • Limited Login (iOS)

  • App Events

  • Hybrid App Events

  • Other App Schemes

  • URL Scheme Suffix

  • Graph API Calls

  • Game Request

  • Send Dialog

  • Share Dialog

  • Log custom events

  • With event parameters

  • Log purchase events

  • With purchase parameters

  • Manual Activate Logging

  • Facebook Profile

  • Facebook Status

  • Server Access Token

  • Privacy Compliance

  • Advertiser Id Collection

  • Enabled tracking

  • Disabled tracking

  • Advertiser Tracking

  • Logging App Events

  • Deferred App Links

  • Application Id

  • Application Name

  • Access reauthorization

  • Access expiration checks

  • Tracking features

  • Permission checks

  • User data tracking

  • Data processing

  • Full data tracking

  • Limited data use

  • Customized data processing options

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

press to zoom

press to zoom
1/3

The following action groups:

  • Facebook

  • Auth

  • Profile

  • General

  • Dialog

  • Events

  • Tracking

  • Compliance

Facebook

  • Get Application Id - Request to get the application id.


  • Get Application Name - Request to get the application name.


  • Set Application Id - Set the application id, must only be the ones in the 'Other app schemes' property.

  • Id - The Facebook application id.


  • Set Application Name - Set the application name.

  • Name - Name of the Facebook application.



Auth

  • Login - Log in to Facebook, with permissions and tracking.

  • Permissions - List of permissions separated by a separator, e.g. "public_profile,email,user_friends".

  • Separator - The separator for the list of permissions, default is a comma ",".


  • Limited Login (iOS) - Log in with limited tracking, for iOS devices.

  • Permissions - List of permissions separated by a separator, e.g. "public_profile,email,user_friends".

  • Separator - The separator for the list of permissions, default is a comma ",".

  • Nonce - The nonce parameter.


  • Logout - Log off user from Facebook.



Profile

  • Get Profile - Request the user's Facebook profile.


  • Get Status - Get the current Facebook session status.

  • Source - Choose where to get the user Facebook status fresh from the Facebook servers or from the cache in the application device.



General

  • Check Permissions - Check if all permissions in the list are included.

  • Permissions - List of permissions separated by a separator, e.g. "public_profile,email,user_friends".

  • Separator - The separator for the list of permissions, default is a comma ",".


  • Check If Access Expired - Check if access data is already expired.


  • Reauthorize Data Access - Request reauthorization of data access.


  • Call - Allows access to the Facebook Graph API, which accesses more features.

  • Path - The Graph API path, e.g. "me/?fields=id,birthday&access_token=".

  • Permissions - List of permissions separated by a separator, e.g. "public_profile,email,user_friends,user_birthday".

  • Separator - The separator for the list of permissions, default is a comma ",".

  • Method - The http method, e.g. "GET". Defaults to "GET" if empty.

  • Tag - The tag to differentiate requests.



Dialog

  • Share - Share dialog gives people the ability to publish an individual story to their timeline, a friend's timeline, a group, or in a private message on Messenger.

  • Href - The link attached to this post. Leave empty to use the current. Leave empty to exclude.

  • Hashtag - A hashtag specified by the developer to be added to the shared content. Leave empty to exclude.

  • Image (iOS) - To share an image, input the Base64-encoded string, but it must only be the Base64 data. Leave empty to exclude. (iOS only)

  • Mode (iOS) - Specify the share dialog mode, default is automatic. (iOS only)


  • Game Request - Game requests give players a mechanism for inviting their friends to play a game. Requests are sent by a player to one or more friends, and always carry a call-to-action for the game. Recipients can be existing players or new players.

  • Title - The title for the Dialog. Maximum length is 50 characters.

  • Message - A plain-text message to be sent as part of the request.

  • Data - Additional freeform data you may pass for tracking. This will be stored as part of the request objects created. The maximum length is 255 characters.

  • Action Type - Used when defining additional context about the nature of the request.

  • Object Id - The Open Graph object Id of the object being sent. Set only if action type is "send" or "askfor".

  • Filters - This controls the set of friends someone sees if a multi-friend selector is shown. If left empty, the multi-friend selector will display all of the user's Facebook friends.


  • Send - With the Send Dialog people can privately send content to specific friends. They'll have the option to privately share a link as a Facebook message. The Send Dialog does not require any extended permissions.

  • Link - The URL that is being sent in the message.



Events

  • Plan Event Parameter - Plan a key-value pair parameter for the next "Log Event".

  • Key - The key of the key-value pair parameter.

  • Value - The value of the key-value pair parameter.


  • Log Event - Log a Facebook event.

  • Name - Write the name of the Facebook event.

  • Value To Sum - An arbitrary number that can represent any value (e.g., a price or a quantity). When reported, all of the valueToSum properties will be summed together.

  • Params - If "default" this will load the planned log event parameters. Otherwise, if set "specify" it will load the specified JSON string below.

  • Params (JSON) - The parameters in JSON string, if params set to "specify".


  • Plan Purchase Parameter - Plan a key-value pair parameter for the next "Log Purchase".

  • Key - The key of the key-value pair parameter.

  • Value - The value of the key-value pair parameter.


  • Log Purchase - Log a Facebook purchase event.

  • Currency - The currency of the purchase.

  • Value - The value of the purchase relative to the currency.

  • Params - If "default" this will load the planned log purchase parameters. Otherwise, if set "specify" it will load the specified JSON string below.

  • Params (JSON) - The parameters in JSON string, if params set to "specify".


  • Manual Activate Logging - Run to manually activate events logging.



Tracking

  • Set Data Processing Options - Set the Data Processing Options as part of compliance with the CCPA.

  • Options - List of data processing options separated by the specified separator, e.g. "LDU" for (Limited Data Use). Set empty for default full data tracking.

  • Separator - The separator for the list of data processing options, default is a comma ",".

  • Country - Specify the country geolocation for limited data use (LDU), e.g. "0" to simply enable, "1" to target USA. Set empty for full data tracking.

  • State - Specify the state geolocation for limited data use (LDU), e.g. "0" to simply enable, "1000" to target California. Set empty for full data tracking.


  • Plan User Data - Plan a key-value pair data for the next "Set User Data".

  • Key - This user data object property key.

  • Value - This user data object property value.


  • Set User Data - Set user data from previously planned user data.


  • Set User Data (JSON) - Set user data from a JSON string.

  • JSON - The JSON string of the user data object.


  • Clear User Data - Clear the user's Facebook data.



Compliance

  • Set Advertiser Id Collection - Enable or disable advertiser id collection. If the "Advertiser Id Collection" property in the compliance section for startup is unchecked, then set this enabled to start advertiser id collection.

  • Toggle - Enable or disable advertiser id collection.


  • Set Event Logging - Enable or disable event logging. If the "Log Events" property in the compliance section for startup is unchecked, then set this enabled to start event tracking.

  • Toggle - Enable or disable event tracking.


  • Set Advertiser Tracking - Enable or disable advertiser tracking. Make sure to always set this enabled after startup to allow advertiser tracking.

  • Toggle - Enable or disable advertiser tracking.


  • Get Deferred App Link - Request the deferred app link, this will update the "GetDeferredAppLink" expression. Make sure to successfully request permission using the Mobile IDFA plugin before running this.

Conditions

The following condition groups:

  • Facebook

  • Auth

  • Profile

  • General

  • Dialog

  • Tracking

  • Compliance

  • Debug

press to zoom

press to zoom

press to zoom

press to zoom
1/4

Facebook

  • On Get App Name - Trigger fires when the application name is received after a request.


  • On Get App Id - Trigger fires when the application id is received after a request.


  • On Set App Id - Trigger fires when the new application id is updated after a setting request.


  • On Set App Name - Trigger fires when the new application name is updated after a setting request.



Auth

  • On Login - Trigger fires when the login request has succeeded.


  • On Login Failure - Trigger fires when the login request has failed.


  • On Limited Login - Trigger fires when the limited login request has succeeded.


  • On Limited Login Failure - Trigger fires when the limited login request has failed.


  • On Logout - Trigger fires when the logout request has succeeded.


  • On Logout Failure - Trigger fires when the logout request has failed.



Profile

  • On Get Profile - Trigger fires when a get profile request has succeeded.


  • On Get Profile Failure - Trigger fires when a get profile request has failed.


  • On Get Status Failure - Trigger fires when a get status request has failed.


  • On Get Status - Trigger fires when a get status request has succeeded.



General

  • On Check Permissions Failure - Trigger fires when a check of permissions request has failed.


  • On Check Permissions - Trigger fires when a check of permissions request has succeeded.

  • Result - Compare whether all specified permissions are included or not.


  • On Check Data Access Failure - Trigger fires if check for data access expiration has failed.


  • On Check Data Access - Trigger fires if check for data access expiration has succeeded.

  • Status - Compare whether data access is still active or expired.


  • On Reauthorize - Trigger fires when a reauthorization of data access has succeeded.


  • On Reauthorize Failure - Trigger fires when a reauthorization of data access has failed.


  • On Call - Trigger fires when a Call Graph API request has succeeded.

  • Tag - The tag to differentiate requests.


  • On Call Failure - Trigger fires when a Call Graph API request has failed.

  • Tag - The tag to differentiate requests.


  • On Any Call Failure - Trigger fires when any Call Graph API request has failed.


  • On Any Call - Trigger fires when any Call Graph API request has succeeded.


  • Is Logged In - Check if the application has logged in successfully and has not logged out yet.


  • Compare Tag - Compare the tag to differentiate requests.

  • Tag - The tag to differentiate requests.



Dialog

  • On Share - Trigger fires when a share dialog request has succeeded.


  • On Share Failure - Trigger fires when a share dialog request has failed.


  • On Game Request Failure - Trigger fires when a game request dialog has failed.


  • On Game Request - Trigger fires when a game request dialog has succeeded.


  • On Send - Trigger fires when a send dialog request has succeeded.


  • On Send Failure - Trigger fires when a send dialog request has failed.



Tracking

  • On Set User Data Failure - Trigger fires when a setting of user data has failed.


  • On Set User Data - Trigger fires when a setting of user data has succeeded.


  • On Clear User Data - Trigger fires when a clearing of user data has succeeded.


  • On Clear User Data Failure - Trigger fires when a clearing of user data has failed.



Compliance

  • On Get Deferred Link - Trigger fires when a get deferred app link request has succeeded.


  • On Get Deferred Link Failure - Trigger fires when a get deferred app link request has failed.



Debug

  • On Error - Trigger fires when an error event fires after a failure.

Expressions

press to zoom

press to zoom

press to zoom
1/2

The following expression groups:

  • Facebook

  • Auth

  • Profile

  • Status

  • General

  • Compliance

  • Debug

  • Login

  • Limited Login

  • Requests

Facebook

  • GetAppId - Return the received application id.


  • GetAppName - Return the received application name.



Auth

  • GetFacebookStatus - Return the Facebook status received after a successful login, limited login, reauthorize data access or get status request.


  • GetUserId - Return the user id received after a successful login, limited login, reauthorize data access or get status request.



Profile

  • GetProfile - Get the updated profile data in JSON string after a successful get profile request.


  • GetFirstName - Get the first name after a successful get profile request.


  • GetLastName - Get the last name after a successful get profile request.


  • GetProfileUserId - Return the user id received after a successful get profile request.



Status

  • GetStatus - Get the updated status data in JSON string after a successful login, limited login, reauthorize data access or get status request.



General

  • GetCallResponse - Returns the Call API response, in JSON string.


  • GetCallProperty - Returns the value from a key of the Call API response's object property. This will output an empty string if not found.

  • Key - The key of the property value.



Compliance

  • GetDeferredAppLink - Return the deferred application link after a successful "Get Deferred Link" request.



Debug

  • ErrorCode - Return the error code after a failure event.


  • ErrorMessage - Return the error message after a failure event.


  • Error - Return the error data in JSON string after a failure event.



Login

  • GetAccessToken - Return the access token received after a successful login, reauthorize data access or get status request.


  • GetAccessExpiration - Return the "data_access_expiration_time" received after a successful login, reauthorize data access or get status request.


  • GetExpiresIn - Return the "expiresIn" data received after a successful login, reauthorize data access or get status request.



Limited Login

  • GetAuthToken - Return the authentication token received after a successful limited login request.


  • GetNonce - Return the nonce received after a successful limited login request.



Requests

  • Tag - The tag to differentiate requests.

Object   Properties

Plugin Properties

press to zoom

press to zoom
1/1

The following property groups:

  • Config

  • Facebook

  • Advanced

  • Compliance

Config - The plugin configuration section.

  • Debug - Toggle whether to enable or disable logging of processes.



Facebook - The Facebook service configuration section.

  • App Id - The id of the Facebook application.

  • App Name - The name of the Facebook application.



Advanced - The advanced Facebook service configuration section.

  • Hybrid App Events - Toggle to whether enable or disable conversion of pixel events into mobile app events.

  • Other App Schemes - To dynamically switch between multiple app ids on iOS, specify each additional app id you will use, separated by a comma ",".

  • URL Scheme Suffix - When using the same Facebook app with multiple iOS apps, set here the unique URL Suffix for each app to ensure that Facebook redirects back to the correct app after closing the login window.



Compliance - The compliance configuration section.

  • Log Events - Enable or disable the logging of app events on startup.

  • Advertiser Id Collection - Enable or disable the collection of the advertiser id on startup.

 
 

Showcase