facebook-javascript-sdk

Facebook Graph API only returns user name

大憨熊 提交于 2019-12-23 11:53:10
问题 I was using Facebook's graph api, asking for '/me', and it only returns the name and Id of the user. I know that it logs in properly, because it returns the correct name. Here is a snippet of the javascript code I was using: FB.login(function (response) { // handle the response FB.api('/me', function (usrresponse) { document.getElementById('inFbStatus').innerHTML = 'Successful login to Facebook'; console.log(JSON.stringify(usrresponse)); }); }, { scope: 'email, basic_info' }); 回答1: You have

FB JS-SDK cannot detect user logging out of FB directly

社会主义新天地 提交于 2019-12-23 07:26:47
问题 TL;DR Facebook javascript SDK cannot determine the accurate login status of a user who has directly logged out from facebook.com underneath it. I'm developing a Facebook app using the javascript SDK for authentication. I've noticed that, when the user logs out of Facebook directly (on facebook.com), then the SDK cannot make sense of the user's login state on the app page. I've boiled it down the the following simple test case. Log in to facebook.com in one tab. In another tab, render the app

Can you call FB.login inside a callback from other FB methods (like FB.getLoginStatus) without triggering popup blockers?

偶尔善良 提交于 2019-12-23 05:49:09
问题 I’m trying to set up a pretty basic authentication logic flow with the FB JavaScript SDK to check a user’s logged-in status and permissions before performing an action (and prompting the user to log in with permissions if they are not). The user types a message into a textarea on my site to post to their Facebook feed, and clicks a ‘post to Facebook’ button on my site. In response to the click, I check the user’s logged-in status with FB.getLoginStatus . In the callback to FB.getLoginStatus ,

Unable to get User Profile Picture With Facebook graph api

ぐ巨炮叔叔 提交于 2019-12-23 04:56:27
问题 my angular 2 app uses facebook login to get username, email and profile picture. I am able to get username and email But url for profile picture provided by facebook api does not work. Here is the flow of the app user logs in to facebook from my app with permission to name,email and profile picture After login the app requests for name,email and profile picture using Facebook api app gets response from facebook api containing all the requested data example below response : { email:"user@mail

adding events information to the facebook profile from 3rd party website

落花浮王杯 提交于 2019-12-23 04:30:29
问题 I am trying to add events information to the facebook users profile from a 3rd party website using Javascript SDK provided by facebook. I just googled for few tutorials and I got this links http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/ http://www.masteringapi.com/tutorials/how-to-ask-for-extended-permission-in-your-facebook-application/32/ http://www.masteringapi.com/tutorials/how-to-create-facebook-events-using-graph-api/49/#using_the_js-sdk I tried with

How to Detect User logged as Page, FB.getLoginStatus doesn't work?

耗尽温柔 提交于 2019-12-23 03:51:26
问题 we have thic piece of code: checkStatus: function() { var self = this; FB.getLoginStatus(function(response) { if (response.status === 'connected') { self.isPage = false; dojo.publish('fb/loginStatus/connected', response.authResponse); if (self.UserRecord === null) { self.buildAll(response.authResponse); } else if (self.UserRecord.user_fid !== response.authResponse.userID){ self.clearAll(); setTimeout(function(){ self.buildAll(); }, 100); } } else { if (response.status === 'not_authorized') {

FB.api does not work when called right after FB.init

ぐ巨炮叔叔 提交于 2019-12-22 18:42:41
问题 FB.api does not work when called right after FB.init. Here is the code snippet I use: window.fbAsyncInit = function() { FB.init({ appId : window.APP_ID, status : true, cookie : true, oauth : true, channelUrl : window.MASTER_URL + "channel", frictionlessRequests : true }); window.COMPANY.init(); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e);

Having issue with Firefox 8 for Mac: window.name is undefined

自古美人都是妖i 提交于 2019-12-22 18:42:39
问题 I've been trying to configure the new Facebook Javascript API with my website, but I'm facing an issue with Firefox (working perfectly fine with Chrome and Safari, yet to test out on IE fully but have been informed of no issues). The issue is being pointed out in the beginning of Facebook's all.js file, with the message saying window.name is undefined if(!window.FB)window.FB={_apiKey:null,...return document.getElementById(a);}}; all.js (line 3) Hence, any subsequent accesses to the SDK using

Facebook Login from subdomains (too many “Valid OAuth redirect URIs”)

我只是一个虾纸丫 提交于 2019-12-22 18:38:37
问题 I've faced with the following problem: I'm using Facebook js sdk for the login process. In App settings Site URL is set to "http://example.com/" , App Domains are "example.com, www.example.com" . In Facebook Login Settings "Valid OAuth redirect URIs" are "http://example.com/, http://www.example.com/" . From the main domain it works just fine, but under subdomain (e.g. http://subdomain.example.com/) i get the following error: "URL Blocked: This redirect failed because the redirect URI is not

Facebook javascript authorization modal dialog with OAuth 2.0

喜欢而已 提交于 2019-12-22 18:25:47
问题 I can do it oldschool: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <div id="fb-root"></div> <script type="text/javascript" src="http://connect.facebook.net/de_DE/all.js"></script> <script type="text/javascript"> function init(){ FB.init({ appId : 'MY_APP_ID', status : true, // check