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.
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.
Share Improve this question asked Aug 13, 2011 at 19:21 AppleGrewAppleGrew 9,57025 gold badges81 silver badges125 bronze badges 3- 1 In the FB docs you linked -- The first example under "Best Practices" gives you a few reasons for why they recommend using a custom channel.html – Jacksonkr Commented Aug 13, 2011 at 20:49
- 3 Yes but I don't get that at all. I need a more elaborate explanation to understand. – AppleGrew Commented Aug 13, 2011 at 20:53
- 4 To be honest, I don't really get it either.. It seems to me that once you figure something out with FB dev, they change it on you and don't tell you why or how to fix it. – Jacksonkr Commented Aug 13, 2011 at 21:12
2 Answers
Reset to default 13The 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 your URL with the access token in the hash. With the Channel URL, they get to pass this token to themselves (their JavaScript running on your domain).
This channel file can then communicate the access token to your active page.
For them to keep all of these things available to only their domain, they need something that works in every browser. Currently, that is a hack of creating popups that are not accessible by javascript running on your server.
Hope this helps.
https://developers.facebook.com/docs/reference/javascript/FB.init/
From the doc:
This is an option that can help address three specific known issues. First, when auto playing audio/video is involved, the user may hear two streams of audio because the page has been loaded a second time in the background for cross domain communication. Second, if you have frame busting code, then you would see a blank page. Third, this will prevent inclusion of extra hits in your server-side logs. In these scenarios, you may provide the optional channelUrl parameter: