1

It looks like Facebook Share's plugin fails when I'm on localhost:3000, even though I have it set up as a URL on my app settings.

First, a screenshot of my app settings: enter image description here

And the code I have in the Head:

     <head>
     <meta property="fb:app_id" content="<%= Rails.application.secrets.facebook_app_id %>"></meta>
 <meta property="og:site_name" content="<%=Rails.application.config.app_name %>"></meta>
 <meta property="og:url" content="<%= request.original_url %>"></meta>
 <meta property="og:type" content="website"></meta>
 <meta property="og:title" content="<%= @user.fb_name %> is doing something"></meta>
 <meta property="og:description" content="this website is awesome!"></meta>
</head>

Finally, here is the plugin html code:

<div class = "row fb_share">
        <div class="fb-like medium-12 columns" data-href="<%= request.original_url %>" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
        </div>

And a screenshot of the share pop-up I get: enter image description here

Any ideas on why this is failing? have Facebook terms for localhost testing changed in 2015?

Laurent
  • 1,554
  • 19
  • 42
  • I guess they are asking for a `domain name`. `localhost` is not a domain that belongs to you. Are you sure the `site url` field is for `development`? Because I think it is for `production`. – Omar Lahlou Aug 17 '15 at 02:53
  • @OmarLahlou in the past it was possible to assign localhost as a domain. See this: http://stackoverflow.com/questions/20910576/how-can-i-add-localhost3000-to-facebook-app-for-development . I also have experience from doing this for a previous app. – Laurent Aug 17 '15 at 03:05
  • One more thing to check: Are you testing your app while connected with your `Facebook` developper account? If no, connect with your developper account and let me know if it works. Because I remember I had almost the same issue with a `Share` button when I was developing an `Android` app. The window popped-up and closed about a half second after because I wasn't logged in with my dev account... – Omar Lahlou Aug 17 '15 at 03:24
  • @OmarLahlou still fails! – Laurent Aug 17 '15 at 03:52
  • Facebook needs to be able to read the content of your URL, to get the Open Graph meta values. It should be obvious that Facebook can not read any data from a URL that points to your localhost – CBroe Aug 17 '15 at 09:20

0 Answers0