ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Facebook functions
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.
Example
Cnt_FACEBOOK is fbSession
FBRequestResult is Variant
sJSON is Buffer
 
Cnt_FACEBOOK.AppID = "FACEBOOK_APP_ID"
Cnt_FACEBOOK.AppSecret = "FACEBOOK_APP_SECRET"
Cnt_FACEBOOK.Permission = [fbInfoProfile]
 
IF Cnt_FACEBOOK.Open() THEN
 
// Interrogate Facebook to retrieve the user
// (equivalent to FBGetUserInformation)
sJSON = Cnt_FACEBOOK.Request("https://graph.facebook.com/me?fields=id,name")
 
IF sJSON <> "" THEN
FBRequestResult = sJSON.ToVariant()
Info(FBRequestResult.id, FBRequestResult.name)
ELSE
Error(ErrorInfo())
END
 
// Interrogate Facebook to retrieve the notifications
sJSON = Cnt_FACEBOOK.Request("https://graph.facebook.com/me/notifications?limit=0")
 
IF sJSON <> "" THEN
FBRequestResult = JSONToVariant(sJSON)
Info(FBRequestResult.summary.unseen_count, FBRequestResult.summary.updated_time)
ELSE
Error(ErrorInfo())
END
ELSE
Error("Unable to connect.", ErrorInfo())
END
Syntax
<Result> = <Session>.Request(<Request> [, <Type> [, <Data>]])
<Result>: Buffer
Result of the request.
<Session>: fbSession variable
Name of the fbSession variable corresponding to the Facebook connection to handle.
<Request>: Character string
Full URL of the 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 to the server (for a POST or PUT request only).
Component: wd290ggl.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/20/2023

Send a report | Local help