|
- Overview
- The elements proposed by WLanguage
- Declaring the application in Facebook
- Declaring the WINDEV application in Facebook
- Declaring the Android application in Facebook
- Declaring the iOS application in Facebook
- Declaring the WEBDEV site in Facebook
- Implementing the Facebook identification in the WINDEV or WINDEV Mobile application or in the WEBDEV site
- Establishing the connection
- Using the Facebook API
Use Facebook identification (prefixed syntax)
Facebook, 1st social network in the world, is very much used by the companies to group their customers. Facebook includes a very powerful API to efficiently exploit the platform. WINDEV, WEBDEV and WINDEV Mobile (for the Android and iOS applications) propose two modes for using Facebook: - a simple use, where the Facebook login of user can be used to identify in the WINDEV or WINDEV Mobile application or in the WEBDEV site. The end user will have less passwords to remember.
- an advanced use, allowing you to interface with Facebook in order to use the Facebook API from a WINDEV or WINDEV Mobile application or from a WEBDEV site.
The principle is the same regardless of the selected use mode. You must: - Declare the WINDEV or WINDEV Mobile application or the WEBDEV site to Facebook.
- Use the Facebook identifiers in the WINDEV or WINDEV Mobile application or in the WEBDEV site.
- Connect to Facebook from the WINDEV or WINDEV Mobile application or from the WEBDEV site to identify the user.
For an advanced use, several WLanguage functions allow you to communicate with Facebook via its API. Versions 22 and laterCaution: This feature is not available for the WINDEV applications in Linux. New in version 22Caution: This feature is not available for the WINDEV applications in Linux. Caution: This feature is not available for the WINDEV applications in Linux. The elements proposed by WLanguage The following WLanguage elements can be used to communicate with Facebook: - the fbSession type. This type of variable contains all the elements required to implement the Facebook connection and authentication .
- several functions:
Declaring the application in Facebook Versions 22 and later New in version 22Implementing the Facebook identification in the WINDEV or WINDEV Mobile application or in the WEBDEV site Establishing the connection To connect to Facebook, you must: - Configure a Facebook session (fbSession variable). In the different proprerties of this variable, you must specify:
 the "App ID" and the "App Secret" supplied when registering the application to Facebook.   the "App ID" supplied when registering the application to Facebook.
- Establish the connection with <fbSession variable>.Start.
For example:
MyConnection is fbSession // Configure the session MyConnection..AppID = "1664XXXXXXXXXXXX" MyConnection..AppSecret = "c6e7XXXXXXXXXXXXXXXXX" // Define the rights: // - Read the email // - Manage the pages MyConnection..Permission = [fbEmail, "manage_pages", "publish_pages", "publish_actions"] // Connection MyConnection.Open()
Using the Facebook API The following example is used to list the pages and groups managed by the current user:
MyConnection is fbSession ... sURL is ANSI string = GRAPHAPI + "me/accounts?local=en_US" sJSON is ANSI string vJSON is Variant
// Retrieves the pages managed by the user sJSON = MyConnection.Request(sURL) vJSON = JSONToVariant(sJSON)
The function returns the JSON response of Facebook.
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |