Skip to content
pakainfo

Pakainfo

Web Development & Good Online education

Guest Posting Sites
  • Home
  • Blog
  • Categories
  • Tools
  • Full Form
  • Guest Post
  • Advertise
  • About
  • Contact Us

Access Tokens – Facebook Login – Facebook Open Graph API

July 8, 2018 Pakainfo Programming, php, SEO Leave a comment

Access Tokens – Facebook Login – Facebook Open Graph API

Contents

  • Access Tokens – Facebook Login – Facebook Open Graph API
    • Facebook Get Access Token
    • Facebook Open Graph API Examples – How to get the access token
    • access token from FB.login
    • Facebook Login for the Web with the JavaScript SDK
    • Related posts

Facebook Get Access Token

How to get the access token
The response object is simple returned with a status data field that lets the
web-app know the current simple fb login status of the users.
Full docs on the simple response object all the data can be found in this documentation
used this method
for FB.getLoginStatus()
The users is not logged into your web-app or you are unable to tell.
Like that get result and set

Also Read This 👉   How to generate a html page dynamically using PHP?

1.App ID
2.check login status
3.enable cookies to allow the
4.server to access the session

-all the response
-parse page for xfbml or html5
-Specify an API version

Facebook Open Graph API Examples – How to get the access token

FB.getAuthResponse()['accessToken']

Facebook Login JavaScript with the Facebook SDK tools for JavaScript enables all the people to sign into must be login facebook your web page with their in this page to Facebook credentials.

FB DEV

Also Read This 👉   Solution Fatal error: Call to undefined function base_url() in Codeigniter

access token from FB.login

FB.login(function(response) {
   if (response.authResponse) {
     var access_token =   FB.getAuthResponse()['accessToken'];
     console.log('Access Token = '+ access_token);
     FB.api('/me', function(response) {
     console.log('Wel come to Good to see you, ' + response.name + '.');
     });
   } else {
     console.log('client cancelled login or logout did not all the fully authorize.');
   }
 }, {scope: ''});

Facebook Login for the Web with the JavaScript SDK

var facebookdevID = '9825647852695875';
function facebookFuncStatusCall(response) {
    console.log('facebookFuncStatusCall');
    console.log(response);

    if (response.status === 'connected') {
      myfirstapi();
	  } else {

      document.getElementById('status').innerHTML = 'Please log ' +
        'into this app.';
    }
  }

  function checkLoginState() {
    FB.getLoginStatus(function(response) {
      facebookFuncStatusCall(response);

    });
  }

  window.fbAsyncInit = function() {
    FB.init({
      appId      : facebookdevID, 
      status     : true,    
      cookie     : true,    
                            
      xfbml      : true,    
                            
      version     : 'v2.9', 
    });

		FB.getLoginStatus(function(response) {
			facebookFuncStatusCall(response);
		});
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

  function doit() {
            alert("do it button clicked!");

  }

function myfirstapi() {
    console.log('Welcome!  Fetching your information.... ');
    FB.api('/me', function(response) {
      console.log('Successful login for: ' + response.name);
      document.getElementById('status').innerHTML =
        'Thanks .. , If you are not ' + response.name + '!  Please logout';

});
  }
 
function hide (elements) {
  elements = elements.length ? elements : [elements];
  for (var index = 0; index < elements.length; index++) {
    elements[index].style.display = 'none';
  }
}

Example

Also Read This 👉   Laravel Import CSV File into MySQL Example

1.What is access token in Facebook?
2.How can I get my Facebook access token?
3.What is meant by access token?
4.How do you find a Facebook page ID?
5.How do I get a Facebook app ID?

Related posts:

  1. Login with Facebook and Twitter
access token facebookfacebook access token expiresfacebook access token generatorfacebook access token toolfacebook graph api explorerfacebook page access tokenget access token facebook without loginhow to get access token facebook graph api php

Post navigation

Previous Post:Youtube Ads Not Showing on Monetized Video 2019 – Problem Solved
Next Post:Top 10 Search Engine Optimization (SEO) Techniques

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here
Guest Posting Sites

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me

Categories

3movierulz (64) Ajax (464) AngularJS (377) ASP.NET (61) Bio (109) Bollywood (108) Codeigniter (175) CSS (98) Earn Money (69) Education (61) Entertainment (130) fullform (86) Google Adsense (63) Highcharts (77) History (40) Hollywood (109) JavaScript (1357) Jobs (42) jQuery (1423) Laravel (1088) LifeStyle (53) movierulz4 (63) Mysql (1029) Mysqli (890) php (2121) Programming (2332) Python (97) Software (166) Software (88) Stories (98) tamilrockers (104) Tamilrockers kannada (64) Tamilrockers telugu (61) Tech (141) Technology (2392) Tips and Tricks (119) Tools (203) Top10 (477) Trading (89) Trending (71) VueJs (250) Web Technology (104) webtools (191) wordpress (166) World (322)

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here
  • Home
  • About Us
  • Terms And Conditions
  • Write For Us
  • Advertise
  • Contact Us
  • Youtube Tag Extractor
  • Info Grepper
  • Guest Posting Sites
  • Increase Domain Authority
  • Social Media Marketing
  • Freelance web developer
  • Tools
Pakainfo 9-OLD, Ganesh Sco, Kothariya Ring Road, Chokadi, Rajkot - 360002 India
E-mail : [email protected]
Pakainfo

© 2023 Pakainfo. All rights reserved.

Top
Subscribe On YouTube : Download Source Code
We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype Guest Posting Sites