https://github.com/prabirshrestha/nancy.facebook.channel
Channel file for Facebook to address issues with cross domain communication in certain browsers.
https://github.com/prabirshrestha/nancy.facebook.channel
Last synced: 3 months ago
JSON representation
Channel file for Facebook to address issues with cross domain communication in certain browsers.
- Host: GitHub
- URL: https://github.com/prabirshrestha/nancy.facebook.channel
- Owner: prabirshrestha
- License: other
- Created: 2012-11-21T22:01:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:28:10.000Z (over 1 year ago)
- Last Synced: 2025-02-10T03:42:38.278Z (4 months ago)
- Language: JavaScript
- Size: 238 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Facebook Channel file library for Nancy Web Framework
Channel file for Facebook to address issues with cross domain communication in certain browsers.
# Installing Nancy.Facebook.Channel
```
Install-Package Nancy.Facebook.Channel
```# Usage
```c#
using Nancy.Facebook.Channel;Get["/facebook/channel"] = _ => Response.AsFacebookChannel();
``````c#
using Nancy.Facebook.Channel;Get["/facebook/channel"] = _ => new FacebookChannelResponse();
``````html
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelUrl : '//WWW.YOUR_DOMAIN.COM/facebook/channel', // Channel File for x-domain communication
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});// Additional initialization code here
};// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));```
*Source: http://developers.facebook.com/docs/reference/javascript/*The channel file addresses some issues with cross domain communication in certain browsers. The contents of the channel.html file can be just a single line:
```html
```It is important for the channel file to be cached for as long as possible. When serving this file, you must send valid Expires headers with a long expiration period. This will ensure the channel file is cached by the browser which is important for a smooth user experience. Without proper caching, cross domain communication will become very slow and users will suffer a severely degraded experience.