PHP code example of hadesker / social-api

1. Go to this page and download the library: Download hadesker/social-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hadesker / social-api example snippets


$accessToken = '....';
$provider = 'facebook'; // supported providers: facebook, google, zalo, naver, kakao

$loginSocialApi = new \Hadesker\SocialApi\Handle($provider, $accessToken);
$user = $loginSocialApi->getUser();
if ($user) {
    $user->getId();
    $user->getName();
    $user->getPhone();
    $user->getEmail();
    $user->getGender();
    $user->getBirthday();
    $user->getAvatar();
    var_dump($user);
    die;
}
echo 'Access token invalid';