Access Tokens – Facebook Login – Facebook Open Graph API
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
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.
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'; } }
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?