Facepile doesn't work for news.reads action

518 Views Asked by At

I am trying to add facebook facepile plugin to a page. I am trying to use news.reads action in the plugin and it doesn't work.

I am adding:

div class="fb-facepile fb_iframe_widget" data-action="news.reads" data-href="url-with-article" data-max-rows="1" data-width="200"

I understand that if I put news.reads action here I should be able to display images of friends who have read this article

2

There are 2 best solutions below

0
Joakim Syk On

Make sure you have initialized the Javascript with your app id:

<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=0&appId=YOUR_APP_ID";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Also, read the section called "Why is nothing displaying?" here: http://developers.facebook.com/docs/reference/plugins/facepile/

If all else fails, try the IFRAME version and see if you get any results there.

<iframe src="//www.facebook.com/plugins/facepile.php?href=url-with-article&amp;action=news.reads&amp;size=medium&amp;max_rows=1&amp;width=200&amp;colorscheme=light&amp;appId=YOUR_APP_ID" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px;" allowTransparency="true"></iframe>
1
Brendan On

I found that simply using the Facepile plugin on an Object that had users interacting via read actions automatically showed users that had read the object.

Specifying news.read as the data-action actually made the plugin cease to function.