简体   繁体   中英

Testing Facebook Comments Plugin Locally

I'm adding the Facebook Comments plugin to a site I'm building on my localhost that has a domain similar to: http://subdomain.domain.lom/

I've added the required code to the page and the plugin appears correctly and I can add comments. The only thing is that it displays a warning message:

Warning: http://subdomain.domain.lom/path is unreachable

I've also added the moderation <meta> tag to the head of my site:

<meta property="fb:app_id" content="{APP-ID}"/>

But when I login to the Facebook comment moderation tool, I don't see any of the test comments I've added.

Is this because I'm testing locally? If so, is there a way I can get the moderation working while developing locally?

You're going to have to fake facebook into believing this is local. Since comments are based upon a distinct URL, then give it a url to the real website (but to a fake page).

So if your production page is http://www.example.com/examplesAndHowTos.php then do http://www.example.com/examplesAndHowTos.php?id=test for the comments url. Be sure to place the fb:admins in the production page so when Facebook lints it, it can grab those values correctly.

is your site accessible to the outside world even though it's local? what's giving you that warning message?

sounds to me that your page is just not accessible to facebook, since it's only available on a local network you are using.

如果你想在本地测试它,你应该使用主机名'localhost',以便facebook知道它将无法访问你的页面。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM