mehmetbeyhz / facebook-api
Facebook rest api
dev-master
2019-09-16 07:28 UTC
This package is not auto-updated.
Last update: 2025-03-25 16:20:06 UTC
README
Setup
composer require mehmetbeyhz/facebook-api:dev-master
Login With Username and Password
require_once "vendor/autoload.php"; $fb = new facebookAPI\Facebook(); $login = $fb->login("username","password"); $data = json_decode($login, true); $userInfo = $fb->userInfo($data['access_token']); print_r($userInfo);
Login With Device
First check your app permission
require __DIR__.'/../vendor/autoload.php'; $fb = new \facebookAPI\Facebook(); $fb->setAppInfo("YOUR_APP_ID","YOUR_CLIENT_TOKEN"); // $scopes = ['user_likes','public_profile']; array tipinde facebook api izinleri içermelidir. $fb->createAppLoginCode($scopes) $scopes = ['user_likes','public_profile']; $create = $fb->createAppLoginCode($scopes); print_r($create); //JSON Format json_decode($create,true); is array format //isConfirmed token // 5 saniyede bir defa kontrol ettirilebilir. // Send 1 request in 5 seconds $codeControl = $fb->controlAppLoginCode("dfcb23cebc240adf91ed2b5a4f26042a"); print_r($codeControl);