christopherfouquier / facebook
Integrate Facebook SDK into php
dev-master
2015-01-04 00:23 UTC
Requires
- php: >=5.3.0
- facebook/php-sdk-v4: 4.0.*
This package is not auto-updated.
Last update: 2025-03-29 19:13:37 UTC
README
Integrate Facebook SDK into php
- authentification
- permissions management
Installation
Add facebook to your dependencies using composer:
php composer.phar require "christopherfouquier/facebook":"dev-master"
Parameters
- appId : Application ID
- appSecret : Application Secret
- redirectUrl : Url to redirect
- permissions : array of facebook oAuth permissions needed for the app
Usage
The class call :
use facebook\Facebook;
We start sessions
session_start();
The class is instantiated
$facebook = new Facebook(
"xxx",
"xxx"
);
It retrieves the login URL.
$url = $facebook->connect();
It checks if the user is identified.
if (isset($_SESSION['fb_token']) && $_SESSION['fb_token'] != null) {
// Connected
}
else {
echo "<a href='". $url ."'>Connection from facebook</a>";
}
TODO
- Add featured