Search code examples
facebook-appschannel

FB App Channel file. ChannelUrl not loading?


I have a Canvas app on Facebook that simply displays a page hosted on our external site. Working just fine.

What I have noticed in Firefox is there is a continuous loading and error being reported in Firebug:

GET http://0-68.channel.facebook.com/pull?channel=p_...1&partition=1&clientid=3744ab1f&cb=b3di&idle=287

200 Aborted

39.86s

This attempt to load always takes around 40s, and is retried instantly after failure. I have also tried loading the above URL by itself, but this just times out with a "Connection Reset" message.

Is this something to do with my channelUrl directive in the SDK setup? I have this setup as follows:

var channel_url         = "http://mysite.com/facebook/channel/"; // Aside from the domain, this is the actual final url.
var app_id              = "blahblahblah";


// Initialize the facebook object
FB.init({
    appId: app_id, // From the globals set up at the top of this page
    channelUrl : channel_url, 
    cookie: true,
    xfbml: true,
    oauth: true
});

The channel file only has this in it:

<script src="//connect.facebook.net/en_US/all.js"></script>

But I have also tried asynchronous loading the js too.

If I load http://mysite.com/facebook/channel/ in a browser, all is fine.

Any thoughts?


Solution

  • Facebook's JS SDK does long-polling for event updates. If no updates are available the connection will eventually time out, which you will see as Aborted in Firebug.