Help / WLanguage / WLanguage functions / Communication / Facebook functions
  • Starting the session
  • Characteristics of the session
  • Closing the session
  • Application in the background: Specific case from Android 10
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Used to authenticate and log in to Faceboook.
AndroidiPhone/iPadIOS WidgetMac Catalyst This function is not available in the simulator.
Android Caution: This feature is available up to Android 11. Starting with Android 12, this function causes a fatal error.
It is recommended to:
MySession is fbSession
MySession.AppID = "1702546803104741"
MySession.AppSecret = "badf00ddeadbeefbadc0deoff1ce8ecd"
MySession.Permission = [fbInfoProfile, fbEmail]
IF FBStartSession(MySession) THEN

Synchronous authentication Hide the details

<Result> = FBStartSession(<Session>)
<Result>: Boolean
  • True if the connection was established,
  • False otherwise.
<Session>: fbSession variable
Name of fbSession variable corresponding to the connection to initialize.
iPhone/iPadIOS WidgetMac Catalyst

Asynchronous authentication Hide the details

FBStartSession(<Session> , <WLanguage procedure>)
<Session>: fbSession variable
Name of fbSession variable corresponding to the connection to initialize.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called during the connection. This procedure has the following format:
<Procedure name>(Connection, Session)
  • <Connection> is set to:
    • True if the connection was established,
    • False otherwise.
  • <Session> is a variable of type fbSession that corresponds to the initialized connection.

Starting the session

  • FBStartSession authenticates users on a Facebook server. This function initializes the connection with the server and must be called before any interaction with Facebook.
  • iPhone/iPadIOS WidgetMac Catalyst The function uses the Facebook account entered by the user on the phone (if it is specified).
  • Android A single session can be started at a time. If FBStartSession is called while a session is already open, the previous session will be closed.
  • The FBStartSession function must only be called from the main the thread of the application.

Characteristics of the session

The "public_profile" permission is always required when starting a Facebook session. If this permission was not specified in the list of permissions for the fbSession variable passed as parameter to FBStartSession, this permission will be automatically requested.

Closing the session

A started Facebook session is a persistent session: it will remain open:

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
FBStartSession can open a window. If this function is used while the application is in the background, a fatal error will occur.
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
Business / UI classification: Business Logic
Component: wd280ggl.dll
Minimum version required
  • Version 21
This page is also available for…
Click [Add] to post a comment

Last update: 01/10/2023

Send a report | Local help