It seems I'm unable to moderate the Facebook comments of the Facebook comments plug-in.
Bellow the code that we initialy created. As you can see an appId is associated with it. Also, if you vist the page (http://amstelveenz.nl/armageddon/) there is one Facebook comment.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function () {
FB.init({
appId: '1389836761336596',
xfbml: true,
version: 'v2.3'
});
};
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="facebook-comments">
<!-- facebook comments -->
<div class="fb-comments" data-href="<?php echo get_permalink(); ?>" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
<!-- einde facebook comments -->
</div>
When visiting https://developers.facebook.com/tools/comments to manage the comments I'm unable to the comments made on the website.
Also when visiting the page I don't see the moderator view.
The solution I came across quite often was to add the following lines:
<meta property="fb:app_id" content="1389836761336596"/>
<meta property="fb:admins" content="712359589"/>
Ofcourse with my app_id and user_id. This also didn't result in a solution.
Any suggestions?
You need to specify fb:admins on your site to tell us who should be able to admin the comments
Related
When using Facebook's Embedded Posts API, any post that has multiple photos on it is not rendering correctly when the user is logged in to Facebook. Everything shows up fine if no user is logged in. I have tested this in both Firefox (v43.0) and Chrome (v47.0.2526.80 m) and it happens in both places.
Here is the html I'm testing with, in the body (I obviously replaced the app-id with my app-id. The first post has multiple images, the 2nd only has one. When not logged into facebook both posts render correctly. After logging into facebook, the first post fails to render and leaves a blank space on the page, the second still renders correctly.
<div>
<div class="fb-post" data-href="http://facebook.com/106536536125/posts/10153158906711126" data-width="400"></div>
<div class="fb-post" data-href="http://facebook.com/106536536125/posts/10153157143376126" data-width="400"></div>
</div>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'your-app-id',
xfbml: true,
version: 'v2.5'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Is this a bug in the embed code for Facebook posts, or is there something I can do to fix it?
I filed a bug report with Facebook and they confirmed this is a bug and they're starting to work on it.
I set up Facebook comments on a staging site we have, however can't get the Moderation Link to show up:
http://telegram_com.wtstage.sx.atl.publicus.com/article/20150426/NEWS/304269695?nocache=1
I have confirmed that I'm an administrator on the Facebook app account.
I have this in the header:
<meta property="fb:app_id" content="1393680337622798" />
I have this in the 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;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=1393680337622798";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://telegram.com/article/20150426/NEWS/304269695/101116" data-numposts="25" data-version="v2.3" data-colorscheme="light"></div>
I have tried using the live telegram.com url as well as the staging url.
If I swap the url (data-href) for another site I am an administrator on, the Facebook comment moderation link shows up in the comment widget. However if I use any url that is the telegram.com's, the Moderation link does not show up.
Is there a setting or something in Facebook's backend that I could be missing? It seems to me the code would be correct, if it works when I use the same app id, but a different data-href url.
Any suggestions?
I seem to have the same issue using the data-href attribute, however, switching to the init version of the comments plugin sorted my issue.
So now, I'm using the following towards the top of the page:
<script>
window.fbAsyncInit = function () {
FB.init({
appId: '516991728450336',
xfbml: true,
version: 'v2.3',
num_posts: 5,
width: '100%'
});
};
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
And I've got a
<div class="fb-comments"></div>
Further down the page. This way, I don't even need the <meta property="fb:app_id"... either, as that only overrides the appId in the FB.init script.
You can specify the href attribute in the script to modify the URL, but if you don't, it'll just default to your page URL. Further parameters here
I hope it helps.
Is it possible to send notification to facebook application admins when comments are
posted using facebook social comments plugin?
Comment plugin is set up this way:
<meta property="fb:admins" content="111,222,333" />
<meta property="fb:app_id" content="123456789" />
<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;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=123456789";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-comments" data-href="http://example.com" data-num-posts="2" data-width="470" notify="true"></div>
<script>
window.fbAsyncInit = function(){
FB.Event.subscribe('comment.create', function(response){
alert(response);
});
};
</script>
Event subscribe works pretty good in this example(shows response alert), but is it possible to send notification to application administrators?
Your help would be appreciated.
I set up a simple PHP script to email me whenever a comment is posted. The PHP is like this:
<?php
mail('me#example.com','facebook_notification.php',
'Comment activity on http://example.com'.$_GET['path']);
and this JavaScript passes the URL of the comment page to the PHP script:
FB.Event.subscribe('comment.create', function(response){
var dummyImage = new Image;
dummyImage.src = 'http://example.com/facebook_notification.php?path='+response.href.replace('http://','');
});
I can easily add more addresses if I need to.
I've got a facebook iframe page with the following (cut out irrelevant) code. I can't seem to become moderator of the comments. Any idea where i messed up?
(debugging link: https://developers.facebook.com/tools/debug/og/object?q=brandpreview.nl%2Ffbkerst%2Fwhitewishingboard.php)
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta property="fb:admins" content="737418775" />
<meta property="fb:app_id" content="240672092656980"/>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '240672092656980', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
FB.Canvas.setSize({ width: 520, height: 2000 });
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=240672092656980";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div id="fb-root"></div>
<div class="fb-comments" data-href="http://www.facebook.com/brandrepublic.nl" data-num-posts="5" data-width="520"></div>
</body>
First off, you shouldn't place your profile id inside those brackets. You should provide it without:
<meta property="fb:admins" content="737418775" />
Secondly, a requirement from Facebook has to be met; the facebook user who should get moderator priviliges needs to 'Like' your application.
Propably needless to say, but make sure you are logged in to Facebook when looking at your comment plugin.
I had a page with a simple Facebook like button and I needed to know when the user liked the page so I used the edge.create event to do this which all worked fine. I now need to add a like Box plugin to the page to like the client's facebook page and again I need to be notified when someone clicks the like button. However, the subscribe event never fires. Any idea what might be the problem? I am using the xfbml code to add the like box.
It appears to be a bug. Here's a link to official credible sources:
http://developers.facebook.com/bugs/310763168934515
And my jsFiddle here to demonstrate: http://jsfiddle.net/dmcs/3D2GD/1/
EDIT
I've found the solution!
First I put my code onto my own domain rather than jsFiddle to do better testing, however my first try failed as if the code was still on jsFiddle. So I troubleshot the situation further.
Then for the app setting I specified I went in and specified the WebSite url on https://developers.facebook.com/apps/{APP_ID}/summary
Here's my code
<html>
<head>
<title>Like Box example</title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: '{APP_ID}'
});
FB.Event.subscribe('edge.create', function(response) {
alert('You liked the URL: ' + response);
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; //js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={APP_ID}";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like-box" data-href="http://www.facebook.com/Cocacola" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
</body>
</html>
just need to replace code:
<div class="fb-like-box" data-href="http://www.facebook.com/jsfiddle"
data-width="292" data-show-faces="true" data-stream="false" data-header="true">
with this one :
<fb:like-box href="http://www.facebook.com/jsfiddle"
colorscheme="light" show_faces="false" header="false" stream="false"
show_border="false"></fb:like-box>
and it works ok.