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.
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 is fbSession
FBRésultatRequête is Variant
sJSON is Buffer
 
Cnx_FACEBOOK.AppID = "FACEBOOK_APP_ID"
Cnx_FACEBOOK.AppSecret = "FACEBOOK_APP_SECRET"
Cnx_FACEBOOK.Permission = [fbInfoProfile]
 
IF FBStartSession(Cnx_FACEBOOK) THEN
 
// Interrogation de Facebook pour récupérer l'utilisateur
// (équivalent de FBRécupèreInformationUtilisateur)
sJSON = FBRequest(Cnx_FACEBOOK, "https://graph.facebook.com/me?fields=id,name")
 
IF sJSON <> "" THEN
FBRésultatRequête = JSONToVariant(sJSON)
Info(FBRésultatRequête.id, FBRésultatRequête.name)
ELSE
Error(ErrorInfo())
END
 
// Interrogation de Facebook pour récupérer des notifications
sJSON = FBRequest(Cnx_FACEBOOK, "https://graph.facebook.com/me/notifications?limit=0")
 
IF sJSON <> "" THEN
FBRésultatRequête = JSONToVariant(sJSON)
Info(FBRésultatRequête.summary.unseen_count, FBRésultatRequête.summary.updated_time)
ELSE
Error(ErrorInfo())
END
ELSE
Error("Impossible de se connecter.", ErrorInfo())
END
Syntax
<Result> = FBRequest(<Session> , <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).
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