PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
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
Performs a communication request (HTTP request) to the Facebook Graph API.
Versions 22 and later
Windows This function is now available for WEBDEV sites in Windows.
New in version 22
Windows This function is now available for WEBDEV sites in Windows.
Windows This function is now available for WEBDEV sites in Windows.
Example
Cnx_FACEBOOK est un fbSession
FBRésultatRequête est un Variant
sJSON est un Buffer
 
Cnx_FACEBOOK.AppID = "FACEBOOK_APP_ID"
Cnx_FACEBOOK.AppSecret = "FACEBOOK_APP_SECRET"
Cnx_FACEBOOK.Permission = [fbInfoProfil]
 
SI Cnx_FACEBOOK.Ouvre() ALORS
 
// Interrogation de Facebook pour récupérer l'utilisateur
// (équivalent de FBRécupèreInformationUtilisateur)
sJSON = Cnx_FACEBOOK.Requête("https://graph.facebook.com/me?fields=id,name")
 
SI sJSON <> "" ALORS
FBRésultatRequête = sJSON.VersVariant()
Info(FBRésultatRequête.id, FBRésultatRequête.name)
SINON
Erreur(ErreurInfo())
FIN
 
// Interrogation de Facebook pour récupérer des notifications
sJSON = Cnx_FACEBOOK.Requête("https://graph.facebook.com/me/notifications?limit=0")
 
SI sJSON <> "" ALORS
FBRésultatRequête = JSONVersVariant(sJSON)
Info(FBRésultatRequête.summary.unseen_count, FBRésultatRequête.summary.updated_time)
SINON
Erreur(ErreurInfo())
FIN
SINON
Erreur("Impossible de se connecter.", ErreurInfo())
FIN
Syntax
<Result> = <Session>.Request(<Request> [, <Type> [, <Data>]])
<Result>: Buffer
Result of request.
<Session>: fbSession variable
Name of the Variable of type fbSession corresponding to the Facebook connection to handle.
<Request>: Character string
Full URL of request (including the parameters stored in the URL if necessary).
<Type>: Optional Integer constant
Type of HTTP request to send:
httpDeleteDELETE method.
httpGet
(default value)
GET method.
httpPostPOST method.
httpPutPUT method.
<Data>: Optional buffer
Data to send onto the server (for a POST or PUT request only).
Component: wd270ggl.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment