ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The fbSession type is used to describe a connection to the Facebook service and to manage the authentication to this service. The characteristics of this connection can be defined and changed using different WLanguage properties.
Important: Before using this WLanguage type, the application must be declared 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 sites.
Android Caution: This feature is available up to Android 11. Starting with Android 12, this function causes a fatal error.
It is recommended to:
Example
MySession is fbSession
MySession.AppID = "1702546803104741"
MySession.AppSecret = "badf00ddeadbeefbadc0deoff1ce8ecd"
MySession.Permission = [fbInfoProfile, fbEmail]
IF FBStartSession(MySession) THEN
Info("Connected")
END
Remarks

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 stringSecret code of the application supplied when declaring the Facebook application.
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: Used to access the first email address of a person.
  • fbInfoFriends: "user_friends" permission: Used to access the liste of friends for your application.
  • fbInfoProfile: "public_profile" permission: Used to access the public profile of a person.
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.

Closing the session

A started Facebook session is a persistent session: 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: 01/26/2023

Send a report | Local help