facebook-javascript-sdk

Email scope is not working which is used in FB Login

你离开我真会死。 提交于 2019-11-30 05:44:49
问题 I try to use FB Login on my website and need to get user informations ( email, public_profile, date of birth and location ). But after logged in only name and facebookId of user that I got. Codes : <img src="" alt="" onclick="fblogin();"/> Javascript part : function statusChangeCallback(response) { console.log('statusChangeCallback'); console.log(response); // The response object is returned with a status field that lets the // app know the current login status of the person. // Full docs on

Uploading a canvas image to facebook as Blob of multipart/form-data type

瘦欲@ 提交于 2019-11-30 05:36:24
问题 I am trying to use the facebook api to upload an image from a canvas I save on the page: var file = dataURItoBlob(canvas.toDataURL('image/jpeg', 1.0)) FB.api('/me/photos', 'POST', { source: file, message: 'photo description' }, function (response) { console.log(response) } ) This is the blob convertor: function dataURItoBlob(dataURI) { var byteString = atob(dataURI.split(',')[1]); var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length;

Dynamically generate description for explicitly shared open graph story through FB.ui Share Dialog

五迷三道 提交于 2019-11-30 05:27:11
Of all of the research I've done on this topic, 90% of it is outdated, which brings me to believe there have been recent changes to the Facebook JS SDK regarding explicitly sharing Open Graph stories. I have the following code: function postToFB(desc){ FB.ui({ method: 'share_open_graph', action_type: 'mynamespace:myaction', action_properties: JSON.stringify({ myobject: "myobjectid" }) }, function(response){}); } The problem with this is that it will attempt to share myobject with only the settings I've set up in the Facebook Open Graph section of my app settings. I would like to use the same

Method FB.ui loads forever when called on Firefox and Internet Explorer

霸气de小男生 提交于 2019-11-30 05:25:21
I have problem in a script that was working until 3 or 4 days ago. I'm using this (simplified version) code to send an app request to a user and it was working until few days ago, now it seems that something in facebook has changed and the window (wich is opened in iframe automatically) loads forever in Firefox and Internet Explorer. It continues to work normaly. I Know that I can force the parameter display: 'popup', but sending the request after some other javascript lines it means that firefox blocks the popup opening and so it is useless for me. function Test() { FB.ui({method:

FB.logout() called without an access token. javascript sdk

我们两清 提交于 2019-11-30 04:13:06
Totally lost on this and docs don't really give any insight on this... Using the Facebook Javascript SDK in my app with this login button code: <fb:login-button scope="manage_pages,read_insights,ads_management" autologoutlink="true" size="large"></fb:login-button> As per the docs, autologoutlink=true param turns the login button to log out once the user is logged in. I want to keep this functionality and not write my own button code This event calls FB.logout but still returns the error message in the callback FB.Event.subscribe('auth.logout', function(response) { FB.logout(function(response)

Is there a Facebook Share button event for FB.Event.subscribe?

馋奶兔 提交于 2019-11-30 04:13:05
I'm looking to split test clicks between the Facebook Like button and Facebook Share button. I know I can attach an event handler of FB.Event.subscribe('edge.create',...) to track clicks on the Facebook like button, but is there a corresponding event for the Facebook share button? There doesn't appear to be on in the FB.Event.subscribe documentation. There is no event for this - if you need to be notified when a user clicks shares from within your app, you should create your own share button and display the Feed/Share dialog when clicked: $('#shareButton').click(function() { FB.ui({ method:

Is channelUrl parameter for Facebook init() deprecated?

独自空忆成欢 提交于 2019-11-30 02:58:48
问题 I remember that there was a channelUrl option for FB.init() , but it seems that it does not exist anymore according to this page Is this feature deprecated? 回答1: Yes, channelUrl is no longer required. Here's a quote from the blog post: Changed browser requirements for the JavaScript SDK In order for the JavaScript SDK to be able to communicate with Facebook, we now require either native support for HTML5 postMessage, or support for Flash, minimum version 8.0.24. As part of this change, we are

FB.getLoginStatus never fires the callback function in Facebook's JavaScript SDK

淺唱寂寞╮ 提交于 2019-11-30 02:52:56
问题 The simple thing of calling FB.init (right before </body> ) and then FB.getLoginStatus(callback) doesn't fire the callback function. After some debugging, I think the SDK is stuck in the "loading" (i.e. FB.Auth._loadState == 'loading' ) phase and never gets to "loaded", so all callbacks are queued until the SDK has loaded. If I force-fire the "loaded" event during debugging - with FB.Event.fire('FB.loginStatus', 'loaded') in case you're intersted - then the callbacks are invoked correctly.

SecurityError from Facebook and Cross Domain Messaging

回眸只為那壹抹淺笑 提交于 2019-11-30 00:44:36
问题 We have an application that utilizes the facebook javascript sdk and login capabilities. We've been noticing this error come up in our production logs. Specifically for iOS devices with versions 10.3 and higher. Also seems to only be targeting safari browsers SecurityError (DOM Exception 18): Blocked a frame with origin "https://www.mymadeupsite.com" from accessing a frame with origin "https://staticxx.facebook.com". The frame being accessed set "document.domain" to "facebook.com", but the

Why this Facebook javascript-sdk login code is automatically logging the user again and again?

余生长醉 提交于 2019-11-29 23:59:54
问题 Here I am unable to keep a user logged out once the user presses the logout button from my site. He is redirected to the login page but updateButton function is called again with same credentials he is getting logged in again. I tried several ways but the problem persists. I guess I am not doing things rightly in updateButton function down here and also FB.logout() is not being done correctly, as I get the error "FB.logout called without an access token" in the console. The code is as follows