PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Starting the session
  • Characteristics of the session
  • Stopping the session
  • Application in the background: Specific case from Android 10
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
Used to authenticate and log in to Faceboook.
AndroidiPhone/iPadIOS WidgetMac Catalyst This function is not available in the simulator.
Example
MaSession is fbSession
MaSession.AppID = "1702546803104741"
MaSession.AppSecret = "badf00ddeadbeefbadc0deoff1ce8ecd"
MaSession.Permission = [fbInfoProfile, fbEmail]
IF FBStartSession(MaSession) THEN
Info("Connecté")
END
Syntax

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

Authentification asynchrone 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 Procedure WLanguage (also called "callback") called on connection. This procedure has the following format:
<Nom de la procédure>(Connexion, Session)
where:
  • <Connection> is:
    • True if the connection was established,
    • False otherwise.
  • <Session> is an Variable of type fbSession corresponding to the initialized connection.
Remarks

Starting the session

  • The FBStartSession function is used to authenticate to a Facebook server. This function initializes the connection with the server and it must be called before any communication with Facebook.
  • iPhone/iPadIOS WidgetMac Catalyst The function is using the Facebook account entered by the user on the phone (if this account is specified).
  • Android A single session can be started at a time. If the FBStartSession function 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.
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 FBStartSession, this permission will be automatically requested.

Stopping the session

A started Facebook session is a persistent session: it will remain opened:
  • until the application is closed.
  • until the call to FBStopSession.
Versions 25 and later
Android

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.
Tips:
  • 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.
New in version 25
Android

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.
Tips:
  • 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.
Android

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.
Tips:
  • 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: wd270ggl.dll
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment