facebook-javascript-sdk

Why do we need to create a channel.html on our server to use Facebook JS SDK?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 07:09:11
问题 I really don't understand why do we need to create channel.html file, as mentioned by FB docs. I also want to understand how it is used. In my logs I don't see this file being ever requested. 回答1: The channel file is to provide a way to do cross domain communication between FB's servers and your own. The reason for this is their tight control over access tokens. You must authenticate a redirect url and app id to retrieve this access token. In order for them to pass you the token, they hit

facebook like button not displaying :: FB.getLoginStatus() called before calling FB.init()

情到浓时终转凉″ 提交于 2019-11-29 06:59:08
I just want a basic facebook like button on my site. I follow the instructions per facebooks site (http://developers.facebook.com/docs/reference/plugins/like/). I tried the HTML5 , XFBML , and iFrame ways, no joy on either. So I thought maybe it's something with my site interfering. So I created a bare-bones html page like below and it still gives me the FB.getLoginStatus() called before calling FB.init() error. <html> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id;

Failed to render Facebook comments on Android WebView via local HTML

*爱你&永不变心* 提交于 2019-11-29 04:20:10
I have a simple activity that create a WebView to load Facebook Comments, e.g. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView myWebView = (WebView) findViewById(R.id.webView); WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); // myWebView.loadUrl("http://192.168.0.2/facebook.html"); // See 1st image myWebView.loadUrl("file:///android_asset/facebook.html"); // See 2nd image } Only the call to remote html file work, but the local one does not work. See the following

How to log out user from facebook application, but maintain login from facebook

时光总嘲笑我的痴心妄想 提交于 2019-11-29 04:12:16
I have tried the PHP SDK (v.3.1.1), and the current Javascript SDK as suggested here : https://developers.facebook.com/docs/guides/web/ now when trying to log out I have tried both FB.logout() ( for js ) and $facebook->getLogoutUrl() ; as the documentation for both clearly state, these methods log the user out of the application as well as their facebook session. But I only need to log the user out of the facebook application ( the test site ). I have tried logging the user out of my test site, ignoring the facebook aspect. But in this case, when the user clicks the login button again, the

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

混江龙づ霸主 提交于 2019-11-29 03:38:22
问题 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

“Uncaught (in promise) undefined” error when using with=location in Facebook Graph API query

♀尐吖头ヾ 提交于 2019-11-29 01:03:35
I am currently developing a web application with the Facebook Graph API. My current goal is to retrieve only posts which have a location attached. While retrieving posts with and without location is already working, I am not able to retrieve only posts with location. The query which retrieves both types looks like this: '/me/feed?fields=id,name,message,picture,place,with_tags&limit=100&with=location' The query which should retrieve only posts with location looks like this: /me/feed?fields=id,name,message,picture,place,with_tags&limit=100&with=location The problem I have is that with the

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

前提是你 提交于 2019-11-29 01:01:41
问题 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. 回答1: 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

Facebook Login API HTTPS Issue

99封情书 提交于 2019-11-29 01:01:36
The website I'm working on has a Facebook login option, but recently a user reported it wasn't working for them. I disabled my extensions etc, I got this error in my console: Blocked a frame with origin "https://www.facebook.com" from accessing a frame with origin "http://static.ak.facebook.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match. Is there an option I can feed to the API that will get it to work on the same protocols? FYI, the primary website runs on HTTP (no S). It is especially odd because it seems

Facebook Javascript SDK Problem: “FB is not defined”

别来无恙 提交于 2019-11-28 21:04:29
The following code, copied from the Facebook documentation here , is not working for me in Chrome. <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId : 'YOUR APP ID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); </script> In the Javascript console I get: Uncaught ReferenceError: FB is not defined I'm not having any problems with the SDK in Firefox or Safari, just Chrome. I saw a case where Chrome had installed WidgetBlock which was

Get user basic information using facebook Login button plugin?

谁说我不能喝 提交于 2019-11-28 20:44:33
Here I am using Facebook Login button plugin and javascript sdk I am able to successfully login and logout by using above. When a first time user has gone through authentication process I need to store user basic information i.e. Facebook login name, email in my database. Please suggest how I can do this. <p><fb:login-button autologoutlink="true"></fb:login-button></p> <div id="fb-root"></div> <script> window.fbAsyncInit = function () { FB.init({ appId: '123456', status: true, cookie: true, xfbml: true }); }; (function () { var e = document.createElement('script'); e.type = 'text/javascript';