Facebook Request Dialog is used to invite friends to start using an application, or to send requests for some specific action to application users. It is implemented in two forms: as a button or as a link, on which user has to click to open the request dialog. There is also an option to open it automatically on page load.
Request Dialog Image
Following image represents the Facebook Request Dialog. Pictures of friends and last names are hidden, because of privacy protection.
PHP Example
The example shows default Facebook Request Dialog, which is shown on picture above. The example shows the code of whole page, but important content is highlighted: required includes and initialization for any page with brown color, and working with Facebook Request Dialog PHP class with blue color.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>Facebook Request Dialog PHP Example</title> </head> <body> <?php require_once 'facebook.php'; require_once 'faceconn/faceconn.php'; UseGraphAPI(); $request = new RequestDialog(); $request->SetMessage("Try Facebook Connect PHP Toolkit"); $request->Render(); ?> </body> </html>
Configuration
Configuration of the Facebook Request Dialog PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Request Dialog PHP class, there is one required property to set and others are optional. All you have to do is to create new instance of the class, set the message, and call Render() method.




