August 29, 2020
  • 7:24 am Kerala has a rich tradition of Folklore
  • 7:21 am Kerala Folklore Akademi, an independent center for cultural affairs, was established on 28 june 1995
  • 1:22 pm CÁCH MUA GAME BẢN QUYỀN RẺ VÀ UY TÍN NHẤT 2017
  • 12:59 pm Bé Bảo An – Ba Ơi " Nhạc thiếu nhi hay nhất "
  • 12:03 pm TOP 10 MANHWA YOU NEED TO READING 2020 NEW WEBTOON)| TOP 10 SIÊU PHẨM MANHWA KHÔNG THỂ BỎ QUA



In this freestyle coding video I will implement Facebook login using the JavaScript SDK and we will take a look at the Graph API. We will also be working with the Graph API explorer and taking a look at the different permissions that we can request with the access token

CODE: Code for this video

Graph API Explorer:

Register Facebook App:

SPONSORS:
DevMountain Bootcamp –

EDUONIX COURSES: Please use affiliate links from website below

SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support:

FOLLOW TRAVERSY MEDIA:

Nguồn: https://keralafolkloreakademy.com/

Xem thêm bài viết khác: https://keralafolkloreakademy.com/giai-tri/

admin

RELATED ARTICLES

23 COMMENTS

  1. A Moktar Posted on July 14, 2020 at 4:56 am

    Thanks 💐💐

    Reply
  2. REVENANT Posted on July 14, 2020 at 4:56 am

    Great tutorial, works just fine other than some HTTPS certificate configuration you need to do now in 2020 and the obvious outdated css. I was having serious trouble interpreting the official documentation and code I saw online but you explained it perfectly. Thank you!

    Reply
  3. Abrafge Svbeac Posted on July 14, 2020 at 4:56 am

    Thank you so much for all the work and for sharing your knowledge! Your tutorials help so much!
    Even if the topic was really hard for me at first attempt, after your tutorial I start to make progress, thank you very much!!

    Reply
  4. Siosaia Fonua Posted on July 14, 2020 at 4:56 am

    Is there documentation on doing this in reactjs?

    Reply
  5. Muti Ullah Posted on July 14, 2020 at 4:56 am

    Many Thanks for the tutorial i really needed it

    Reply
  6. Nguyễn Cao Tài Posted on July 14, 2020 at 4:56 am

    Can you push seri auto like facebook Grap api for people?

    Reply
  7. Stefan Venter Posted on July 14, 2020 at 4:56 am

    thank you so much for this video! This was exactly what I was looking for. All the basics I need to get started. There is a ton of documentation on this Facebook graph which is kind of overwhelming, but this video made it easy to get started.

    Reply
  8. cristian morales Posted on July 14, 2020 at 4:56 am

    muy bueno, me ayudo bastante.

    Reply
  9. Sam Posted on July 14, 2020 at 4:56 am

    Nobody:
    Brad: Ahhmmmm Excuse Me!!

    Really love cool stuff from you.. <3 I have seen a couple of videos of yours and you are just awesome… Love form Pakistan <3
    Never mind of that little meme joke.. I have seen you doing this in other videos 😀

    Reply
  10. MayaSecond Fleht Posted on July 14, 2020 at 4:56 am

    Ich hatte nur einen einfachen Monat

    Reply
  11. MayaSecond Fleht Posted on July 14, 2020 at 4:56 am

    https://api.video/

    Reply
  12. Salom Dunyo Posted on July 14, 2020 at 4:56 am

    Hello, the video is outdated almost.
    what I wanted is guide for using Instagram with a WEBHOOK feature. or Instagram GRAPH.
    thank you in advance.

    Reply
  13. Abhishek Shah Posted on July 14, 2020 at 4:56 am

    Awesome video

    Reply
  14. flashteQ Posted on July 14, 2020 at 4:56 am

    brilliant brad

    Reply
  15. StockholmStadion Posted on July 14, 2020 at 4:56 am

    What would we do without you?

    Reply
  16. Devashan Pillay Posted on July 14, 2020 at 4:56 am

    when i opened up with live server it gave me this:

    The method FB.getLoginStatus can no longer be called from http pages
    Facebook Login status is only available to HTTPS pages.

    what am i doing wrong? i made the folders and and index document manually, I didnt understand the method he used. I am a beginner at this stuff.

    Reply
  17. Mike Mandala Posted on July 14, 2020 at 4:56 am

    to retrieve using php you can go this route see code below

    require_once( 'C:fakepathvendorfacebookgraph-sdksrcFacebookautoload.php' );

    class Facebook {

    public $ci;

    public $accessToken;

    public $fb;

    public function __construct() {

    // Get CI object.

    $this->ci =& get_instance();

    $this->fb = new FacebookFacebook([

    'app_id' => *"your-app-id"*,

    'app_secret' => *"your-app-secret"*,

    'default_graph_version' => 'v2.10',

    //'default_access_token' => '{access-token}', // optional

    ]);

    }

    public function login(){

    $helper = $this->fb->getRedirectLoginHelper();

    $permissions = ['email','publish_to_groups','publish_pages'];
    //you can visit the facebook page and add more scopes
    $loginUrl = $helper->getLoginUrl(base_url('/client/FaceBookHandler'), $permissions);

    echo '<script>window.open("'.$loginUrl.'", "Facebook Popup", "height=500,width=400,resizable=no");</script>';
    //custom popup window
    }

    public function getAccessToken(){

    $helper = $this->fb->getRedirectLoginHelper();

    $accessToken = '';

    try {

    $accessToken = $helper->getAccessToken();

    } catch(FacebookExceptionsFacebookResponseException $e) {

    return false;

    } catch(FacebookExceptionsFacebookSDKException $e) {

    return false;

    }

    $oAuth2Client = $this->fb->getOAuth2Client();

    $tokenMetadata = $oAuth2Client->debugToken($accessToken);

    $tokenMetadata->validateAppId("*your-app-id*");

    $tokenMetadata->validateExpiration();

    if (! $accessToken->isLongLived()) {

    try {

    $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);

    } catch (FacebookExceptionsFacebookSDKException $e) {

    return false;

    }

    }

    if(isset($accessToken) && !empty($accessToken)){

    return $accessToken;

    }

    return false;

    }

    /*Seeting the access token */
    public function setAccessToken($token){

    //$_SESSION['fb_access_token'] = (string) $accessToken;

    $_SESSION['fb_access_token'] = (string) $token->getValue();

    $_SESSION['fb_expires_at'] = strtotime($token->getExpiresAt()->format('Y-m-d H:i:s'));

    try {

    $response = $this->fb->get('/me?fields=id,name', (string) $token->getValue());

    } catch(FacebookExceptionsFacebookResponseException $e) {

    return false;

    } catch(FacebookExceptionsFacebookSDKException $e) {

    return false;

    }

    $user = $response->getGraphUser();

    $_SESSION['fb_user_id'] = $user->getId();

    return array(

    'fb_access_token'=>(string) $token->getValue(),

    'fb_expires_at'=>strtotime($token->getExpiresAt()->format('Y-m-d H:i:s')),

    'fb_user_id',$user->getId());

    }

    }

    /*Testing the code*/
    public function RequestBlogs(){

    // echo "my user id = ".$_SESSION['fb_user_id'];

    echo $this->face->login();

    }

    public function FaceBookHandler(){

    $token = $this->face->getAccessToken();

    if($token != false){

    $result = $this->face->setAccessToken($token);

    if($result != false){

    print_r($result);

    }else{

    echo "Failed to set access token";

    }

    }else{

    echo "Login Failed";

    }

    Reply
  18. Ignacio Ainol Posted on July 14, 2020 at 4:56 am

    excellent contribution thank you very much. Greetings from Chile

    Reply
  19. Junior Commandant Posted on July 14, 2020 at 4:56 am

    Thanks a lot for this tuto . How can we change the style of the facebook button?

    Reply
  20. Crypto Currency Posted on July 14, 2020 at 4:56 am

    Can you please share with me the code here?

    Reply
  21. Crypto Currency Posted on July 14, 2020 at 4:56 am

    Great channel. Thank you so much for sharing all your knowledge. You helped me out so much on understanding a wide variety of frameworks and what they do. Thank you sir!

    Reply
  22. Traduções PtBr Internacionais Séries Filmes Novelas Posted on July 14, 2020 at 4:56 am

    Yes!

    Reply
LEAVE A COMMENT