Loosing my mind over fb:like in iframe apps!
I have an app that is running in iframe canvas mode. And, I am trying to add an fb:like here in this app. I read the documentation and looked at other explanations, but nothing seems to work properly. I will share the details, but when a user hits the like button, I would like to display something like the following (which is what techcrunch and other sites are doing) on user's wall
John Smith likes a link.
[APP LOGO] My App's page title link: my_app_url
Basic description about the current page
whereas, Facebook posts this, which is dull and ugly:
John Smith likes a link.
My App Name (which is a link pointing to the app page) apps.facebook.com apps.facebook.com (not my app url, but generic apps.facebook.com url)
Basically, I looked at the techcrunch site, FB docs, etc. And, what I put in my code is this:
<fb:like href="http://apps.facebook.com/myapp/pageid" send="false" layout="button_count" width="450" show_faces="false" font=""></fb:like>
I init FB using:
$("<div id='fb-root'></div>").appendTo('body');
var e = document.createElement('script');
e.src = document.location.protocol + '//connec开发者_高级运维t.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
window.fbAsyncInit = function() {
FB.init({
appId:appID, cookie:true, status:true, xfbml:true,
channelUrl: mySiteURL + 'fb_channel-1.0.2.html'
});
}
And, on the page I also put the following as meta tags:
<html xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta property="og:site_name" content="Site Name-1"/>
<meta property="og:title" content="Title-1"/>
<meta property="og:image" content="http://mysite.com/logo.png"/>
<meta property="og:description" content="Description-1"/>
<meta name="description" content="Description-2"/>
</head>
But, when the user hits the like button, none of this shows up???
Any help is really really appreciated! Thanks in advance!
Check this link for solution. It worked for me
http://forum.developers.facebook.net/viewtopic.php?pid=354148#p354148
I've tried every possible combination and suggestion in adding og meta tags to my page, but none of them worked. When testing URL with facebook URL Linter it always returned default values defined on application admin page. Like it doesn't see og meta tags. And what was more interesting is that when I look the page source, og meta tags existed but haven't been evaluated by facebook or linter.
Now, in my canvas page I defined login/authentication (and depending redirection etc) at the top, before html and og meta tags definition, and that was the main problem.
If you perform FB login redirection/authentication before providing og meta tags, then FB crawlers/linter will not be able to detect your meta info and will try to auto-fill it.
精彩评论