ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Facebook functions
  • Properties specific to fbSession variables
  • Closing the session
  • WLanguage functions that use a variable of type fbSession
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The fbSession type is used to describe a connection to the Facebook service and to manage the authentication to this service. You can define and change the characteristics of this connection using different WLanguage properties.
Important: Before using this WLanguage type, it is necessary to declare the application to Facebook. For more details, see Using Facebook authentication.
Remarks:
  • For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
  • This type of variable is available in Linux only for WEBDEV websites.
Android Attention: This feature is available until Android 11. Starting with Android 12, this function causes a fatal error.
We advise you to:
Example
MySession is fbSession
MySession.AppID = "1702546803104741"
MySession.AppSecret = "badf00ddeadbeefbadc0deoff1ce8ecd"
MySession.Permission = [fbInfoProfile, fbEmail]
IF FBStartSession(MySession) THEN
	Info("Connected")
END
Properties

Properties specific to fbSession variables

The following properties can be used to handle a Facebook session:
Property nameType usedEffect
AppIDCharacter stringIdentifier of the application supplied when declaring the Facebook application.
AppSecretCharacter string or Secret stringSecret code of the application supplied when declaring the Facebook application.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "Ansi or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
AndroidiPhone/iPadIOS WidgetMac Catalyst This property is ignored.
EmailCharacter stringEmail of the end user (may be used to fill the connection dialog beforehand).
Android This property is ignored.
PageIDCharacter stringIdentifier of the Facebook page to open. If this parameter is empty, the session is started on a user and not on a page.
AndroidiPhone/iPadIOS WidgetMac Catalyst This property is not available.
PermissionArrayRights required during the Facebook connection. The rights (or permissions) to supply are defined by Facebook. The list of available rights can be consulted on the page: https://developers.facebook.com/docs/facebook-login/permissions/v2.3.
For some rights (the most common ones), you have the ability to use the following constants:
  • fbEmail: "email" permission: access to a person's first email address.
  • fbInfoAmis: "user_friends" permission: access to your application's list of friends.
  • fbInfoProfile permission "public_profile": allows access to a person's public profile.
Android 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.
Remarks

Closing the session

An open Facebook session is persistent: it will remain open:

WLanguage functions that use a variable of type fbSession

Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/23/2024

Send a report | Local help