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
  • Starting the session
  • Characteristics of the session
  • Closing the session
  • Incompatibility between the IE ActiveX (and oAuth2) and the use .NET assemblies
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Used to authenticate and log in to Faceboook.
AndroidiPhone/iPadIOS WidgetMac Catalyst This function is not available in the simulator.
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 MySession.Start() THEN
Info("Connected")
END
Syntax
<Result> = <Session>.Open up()
<Result>: Boolean
  • True if the connection was established,
  • False otherwise.
<Session>: fbSession variable
Name of the fbSession variable corresponding to the connection to initialize.
Remarks

Starting the session

  • <fbSession variable>.Start authenticates users on a Facebook server. This function initializes the connection with the server and must be called before any interaction with Facebook.
  • WINDEV A login window appears automatically.
  • 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 <fbSession variable>.Start is called while a session is already open, the previous session will be closed.
  • The <fbSession variable>.Start function must only be called from the main the thread of the application.
Android

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 <fbSession variable>.Start, it will be automatically requested.

Closing the session

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

Incompatibility between the IE ActiveX (and oAuth2) and the use .NET assemblies

When an HTML control is used in WINDEV, this control uses the "Microsoft Web browser" ActiveX system. ActiveX is also used by WINDEV for all OAuth2 authentications (Facebook, Twitter, Google, etc.) that require a validation for the connection via HTML code.
If you use an HTML control (or OAuth2 authentication) and a ".Net" assembly in the same project, you may encounter a compatibility issue between Microsoft .NET layers and the ActiveX framework.
An API can be used to manage both technologies. To do so, write the following line of code in the initialization code of the project or in the initialization code of a class or global procedure if the ".Net" object is initialized in a class or in a set of procedures:
// Used to manage the cohabitation between IE ActiveX and .NET
API("OLE32", "CoInitializeEx", Null, 2)
Component: wd300ggl.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/30/2024

Send a report | Local help